Vermillion Posted September 5, 2008 Share Posted September 5, 2008 "SELECT * FROM access WHERE user_id = '$id', hash = '$hash' AND level = 8"; Like you can see, I want to "SELECT everything from access where the id is $id, the hash is $hash, and the level is 8", but that doesn't work. How would be the right way to do that? Link to comment https://forums.phpfreaks.com/topic/122814-solved-how-can-i-do-this/ Share on other sites More sharing options...
corbin Posted September 5, 2008 Share Posted September 5, 2008 AND where user_id = '$id' AND hash = '$hash'...... Link to comment https://forums.phpfreaks.com/topic/122814-solved-how-can-i-do-this/#findComment-634204 Share on other sites More sharing options...
Vermillion Posted September 5, 2008 Author Share Posted September 5, 2008 So I just keep using the AND clause? Okay, thanks al lot . Link to comment https://forums.phpfreaks.com/topic/122814-solved-how-can-i-do-this/#findComment-634216 Share on other sites More sharing options...
Vermillion Posted September 7, 2008 Author Share Posted September 7, 2008 Woops one thing. If I wanted to update the database with multiple different values, would I do something like this: "UPDATE members SET question = '$newquestion'" AND SET answer = '$answer' WHERE id = "$id" AND hash = '$hash'" ? Or can I only do: "UPDATE members SET question = '$newquestion'" SET answer = '$answer' WHERE id = "$id" AND hash = '$hash' Link to comment https://forums.phpfreaks.com/topic/122814-solved-how-can-i-do-this/#findComment-635613 Share on other sites More sharing options...
BigTime Posted September 7, 2008 Share Posted September 7, 2008 UPDATE members SET question='$newquestion', answer='$answer' WHERE id='$id' AND hash='$hash' Link to comment https://forums.phpfreaks.com/topic/122814-solved-how-can-i-do-this/#findComment-635618 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.