Hypersource Posted November 25, 2012 Share Posted November 25, 2012 Somethings wrong with the syntax of this: $tokens=mysql_query("GET user_name FROM users WHERE user_name=$tik"); Help? error says: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GET user_name FROM users WHERE user_name=Admin' at line 1 Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/271156-whats-wrong-with-this-query/ Share on other sites More sharing options...
iarp Posted November 25, 2012 Share Posted November 25, 2012 SELECT not GET. $tokens=mysql_query("GET SELECT user_name FROM users WHERE user_name=$tik"); Link to comment https://forums.phpfreaks.com/topic/271156-whats-wrong-with-this-query/#findComment-1395014 Share on other sites More sharing options...
beyzad Posted November 25, 2012 Share Posted November 25, 2012 GET? Link to comment https://forums.phpfreaks.com/topic/271156-whats-wrong-with-this-query/#findComment-1395015 Share on other sites More sharing options...
Hypersource Posted November 25, 2012 Author Share Posted November 25, 2012 Now I get Unknown column '[whatevers int $tik variable]' in 'where clause Link to comment https://forums.phpfreaks.com/topic/271156-whats-wrong-with-this-query/#findComment-1395018 Share on other sites More sharing options...
iarp Posted November 25, 2012 Share Posted November 25, 2012 Is $tik quoted at any point before this query, otherwise it'll need single quotes. $tokens = mysql_query("SELECT user_name FROM users WHERE user_name = '$tik'"); Link to comment https://forums.phpfreaks.com/topic/271156-whats-wrong-with-this-query/#findComment-1395024 Share on other sites More sharing options...
Hypersource Posted November 25, 2012 Author Share Posted November 25, 2012 Your right! Link to comment https://forums.phpfreaks.com/topic/271156-whats-wrong-with-this-query/#findComment-1395029 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.