I am trying to determine if any differences exist between a number of fields between rows of a mysql database.
for example, if name field is different in one row echo a result out.
What is the best method for this?
edit:
for example
Name AGE
john smith 68
john smith 68
John M Smith 68
I would like a script that detect the name in the third line is different to the others but to be able to do this for both name and age fields
You first have to think about: Different to what? You always have to define a value a column should have. If you want all rows which are not “john smith” with age 68, your statement would be the following:
That will return all rows that are different to the defined values.
A very basic PHP code example would be the following: