i have a thread in my forum. all the replies are by THE SAME USERNAME. the mysql thing looks like this: (that runs when i post a reply)

mysql_query("UPDATE `replytable` SET `the thing to show if its a mod` = 1 WHERE `by` = '$_SESSION[username]' AND `the thing to show if its a mod` = ''")

i dont understand. this:
its only changing the mod to equal 1 for the row of the current reply i am posting. there are other replies by the same username and the "the thing to show if its a mod" column ALL CELLS ARE EMPTY SO THEY EQUAL (NOTHING) so why isnt it changing all of the ones with the username and mod column equalling empty? does anyone know? it only changes the one i am currently posting.

Recommended Answers

All 2 Replies

Could it be that the field you are trying to compare contains NULL values rather than empty strings?

Could you post more info about the replytable table?

the column for showing if it is mod is not null. varchar 1 latin1_swedish_ci i cant think of anything else that is relevant.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.