Jump to content
  • 0

SQL Error


integral

Question


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  167
  • Reputation:   4
  • Joined:  02/01/12
  • Last Seen:  

Please deem it necessary to move this topic if needed.

I'm having this error:

#1064 - 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 'query_sql "SELECT `char`.char_id,`char`.`name`,global_reg_value.`value` FROM glo' at line 1

when I run this on the database.

query_sql "SELECT `char`.char_id,`char`.`name`,global_reg_value.`value` FROM global_reg_value LEFT JOIN `char` ON global_reg_value.char_id=`char`.char_id WHERE global_reg_value.str='brokeemp' ORDER BY CAST(`global_reg_value`.`value` AS UNSIGNED) DESC LIMIT 10", .@char_id, .@name$, .@count;

On my Breaker Ladder, and it does not store any value in my database.

What is wrong with it? Thank you for the help.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   1
  • Joined:  06/22/12
  • Last Seen:  

You need to have ` marks around each table name. Try this:

query_sql "SELECT `char`.`char_id`,`char`.`name`,`global_reg_value`.`value` FROM `global_reg_value` LEFT JOIN `char` ON `global_reg_value`.`char_id`=`char`.`char_id` WHERE `global_reg_value`.`str`='brokeemp' ORDER BY CAST(`global_reg_value`.`value` AS UNSIGNED) DESC LIMIT 10", .@char_id, .@name$, .@count;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...