newman445617 Posted July 20, 2009 Share Posted July 20, 2009 $lol = $pun_user['username']; if ($logtype > 0) $result = $db->query("SELECT * FROM cashlogs WHERE to = $lol ORDER By time DESC LIMIT $start_from, 25") or error('Unable to fetch log info', __FILE__, __LINE__, $db->error()); else Database reported: 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 'to = newman ORDER By time DESC LIMIT 0, 25' at line 1 (Errno: 1064) Failed query: SELECT * FROM cashlogs WHERE to = newman ORDER By time DESC LIMIT 0, 25 I'm trying to pull up my cashlog's table to show only the log's from the username = newman but it gives me some gay mysql syntax crap? Any help is greatly appreciate, im achieving new learning abilities so i kinda need ur help, thanks! Quote Link to comment https://forums.phpfreaks.com/topic/166560-solved-error-mysql/ Share on other sites More sharing options...
PFMaBiSmAd Posted July 20, 2009 Share Posted July 20, 2009 In your last thread, Crayon Violent pointed out that from was a reserved mysql keyword and he also stated that some of the other column names were also going to be a problem for the same reason. You have an almost identical sql syntax error message as in the last thread, for the same reason - http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html Quote Link to comment https://forums.phpfreaks.com/topic/166560-solved-error-mysql/#findComment-878338 Share on other sites More sharing options...
newman445617 Posted July 20, 2009 Author Share Posted July 20, 2009 In your last thread, Crayon Violent pointed out that from was a reserved mysql keyword and he also stated that some of the other column names were also going to be a problem for the same reason. You have an almost identical sql syntax error message as in the last thread, for the same reason - http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html I didn't know it mattered when selecting... i thought only inserting sorry... Quote Link to comment https://forums.phpfreaks.com/topic/166560-solved-error-mysql/#findComment-878369 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.