Monk3h Posted September 27, 2008 Share Posted September 27, 2008 is this correct? Im trying to use AND but i have no idea how to include it. $check = mysql_fetch_array(mysql_query("SELECT * FROM `alphaground` WHERE `x` = '$x' & `y` = '$y'")); elseif ($check['x'] == $stat['x'] & $check['y'] == $stat['y']) Link to comment https://forums.phpfreaks.com/topic/126071-correct-syntax/ Share on other sites More sharing options...
wildteen88 Posted September 27, 2008 Share Posted September 27, 2008 MySQL does not understand & use AND instead. Link to comment https://forums.phpfreaks.com/topic/126071-correct-syntax/#findComment-651917 Share on other sites More sharing options...
Monk3h Posted September 27, 2008 Author Share Posted September 27, 2008 Thank you, also the second one does not work. (PHP) Any ideas? is the Syntax correct? Link to comment https://forums.phpfreaks.com/topic/126071-correct-syntax/#findComment-651923 Share on other sites More sharing options...
DarkWater Posted September 27, 2008 Share Posted September 27, 2008 You need && for AND in PHP, because & by itself is the bitwise AND operator, which is completely different. Use &&. Link to comment https://forums.phpfreaks.com/topic/126071-correct-syntax/#findComment-651928 Share on other sites More sharing options...
Acs Posted September 27, 2008 Share Posted September 27, 2008 You could also use AND in php, if I am not mistaken Link to comment https://forums.phpfreaks.com/topic/126071-correct-syntax/#findComment-652031 Share on other sites More sharing options...
wildteen88 Posted September 28, 2008 Share Posted September 28, 2008 You could also use AND in php, if I am not mistaken Yes it is an alias to && Link to comment https://forums.phpfreaks.com/topic/126071-correct-syntax/#findComment-652293 Share on other sites More sharing options...
.josh Posted September 28, 2008 Share Posted September 28, 2008 Though you should note that they are not quite the same thing. They have different orders of precedence. Link to comment https://forums.phpfreaks.com/topic/126071-correct-syntax/#findComment-652295 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.