Freid001 Posted June 9, 2011 Share Posted June 9, 2011 Hi I was just wondering can mysql querys include > and < symbols for example mysql query where value > 'value' because below you can see a mysql query I am using the query finds a user in the data base who's location = the users and XP > than the users. However when I run the query it find a user in the correct location but does not seem to showing users with a greater XP? $user = mysql_query("SELECT * FROM Game WHERE XP>'$MAL2' AND Location='$player1location' ORDER BY Rand() LIMIT 1") Thanks Quote Link to comment https://forums.phpfreaks.com/topic/238899-can-mysql-querys-include-and-symbols/ Share on other sites More sharing options...
Pikachu2000 Posted June 9, 2011 Share Posted June 9, 2011 MySQL comparison operators. Quote Link to comment https://forums.phpfreaks.com/topic/238899-can-mysql-querys-include-and-symbols/#findComment-1227554 Share on other sites More sharing options...
Freid001 Posted June 9, 2011 Author Share Posted June 9, 2011 So it should work? Quote Link to comment https://forums.phpfreaks.com/topic/238899-can-mysql-querys-include-and-symbols/#findComment-1227556 Share on other sites More sharing options...
Freid001 Posted June 9, 2011 Author Share Posted June 9, 2011 Cool thanks got it working Quote Link to comment https://forums.phpfreaks.com/topic/238899-can-mysql-querys-include-and-symbols/#findComment-1227557 Share on other sites More sharing options...
fugix Posted June 9, 2011 Share Posted June 9, 2011 try $user = mysql_query("SELECT * FROM Game WHERE XP > $MAL2 AND Location='$player1location' ORDER BY Rand() LIMIT 1") and make sure that your $MAL2 var is passing a valid INT Edit: just saw that you got it working, excellent Quote Link to comment https://forums.phpfreaks.com/topic/238899-can-mysql-querys-include-and-symbols/#findComment-1227558 Share on other sites More sharing options...
Freid001 Posted June 9, 2011 Author Share Posted June 9, 2011 Thanks ! It works fine now Quote Link to comment https://forums.phpfreaks.com/topic/238899-can-mysql-querys-include-and-symbols/#findComment-1227559 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.