siwelis Posted May 20, 2007 Share Posted May 20, 2007 Using PHP, I'm trying to figure out the syntax for a MySQL query to write this: WHERE column1 = '$var1' & column2 = '$var2' I want to execute a script, but only if column1 matches $var1 AND column2 matches $var2. Any help is greatly appreciated. Thank you! Link to comment https://forums.phpfreaks.com/topic/52186-solved-check-two-variables-against-1-db-table/ Share on other sites More sharing options...
bubblegum.anarchy Posted May 20, 2007 Share Posted May 20, 2007 SELECT * FROM table WHERE column1 = '$var1' AND column2 = '$var2' or SELECT * FROM table WHERE column1 = '$var1' && column2 = '$var2' Link to comment https://forums.phpfreaks.com/topic/52186-solved-check-two-variables-against-1-db-table/#findComment-257432 Share on other sites More sharing options...
siwelis Posted May 24, 2007 Author Share Posted May 24, 2007 THANK YOU!!! I thought I had replied to this sooner. It did work and I just wanted to thank you and make this topic resolved so others know this works too! Link to comment https://forums.phpfreaks.com/topic/52186-solved-check-two-variables-against-1-db-table/#findComment-261141 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.