I don’t know how to ask this so I’ll start with what I have already:
mysql_query("UPDATE `questions` SET `votes` = `votes` + 1
WHERE `questionID`='".md5($_GET['q'])."'");
What I want to do is update the row where the md5 hashed version of questionID = some string. Can I do this using MySQL’s md5 function?
Edit:
Would it be something like this then:
"WHERE MD5(`questionID`)='".md5($_GET['q'])."'"
You could, but in that code you’re using PHP’s md5.
EDIT: If you want to search for a row where the hash of the questionID column equals the hash of
$_GET['q'], the second looks right. It’s not clear what you’re using MD5 for, though. Maybe you should give some background.EDIT 2: Since q is already hashed, it should be (with escaping):