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! Quote 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' Quote 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! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.