Home » Php » How to find hash of a database resultset in php

How to find hash of a database resultset in php

Posted by: admin October 26, 2017 Leave a comment

Questions:

I can find the hash of a result set after retrieving it and storing in array using following method.

while( $records[] = mysqli_fetch_array($rs) ) {} 
md5( json_encode($records) ) 

Is there any other faster way to find hash of mysql result ?

Answers:

Consider using hash when fetch data from db

like this.

SELECT MD5(concat(field1, field2, field3, ...)) AS rowhash