Forum Moderators: open
In my database, I have user id's, file names, and number of modifications, looking something like this:
User, File, Modifications
Bob, file1.txt, 2
Kat, file1.txt, 0
Sam, file2.txt, 1
Bob, file3.txt, 4
Ron, file3.txt, 2
In total there have been 9 modifications. Unfortunatly my code only counts 4 using my current method.
This is the code I'm using:
$changes=mysql_num_rows(mysql_query("SELECT id FROM files WHERE modifications>0"));
I know this is wrong, but how better would I write this statement?
Thanks