Jump to content

[SOLVED] error mysql


newman445617

Recommended Posts

$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!

Link to comment
https://forums.phpfreaks.com/topic/166560-solved-error-mysql/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/166560-solved-error-mysql/#findComment-878338
Share on other sites

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...

Link to comment
https://forums.phpfreaks.com/topic/166560-solved-error-mysql/#findComment-878369
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.