Jump to content
  • 0

apostrophes in sql-queries


milky_milk

Question


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  08/10/12
  • Last Seen:  

Hello there.

Do you know how to escape apostrophes in eA-scripts?

For example:

 

 

       query_sql("SELECT `id`  FROM `item_db` WHERE `name_japanese` = '"+.@ITEM$+"'",.@ID);

        if ( !.@ID ) {
 
                mes "There is no such item.";
                close;
        }

 

If .@ITEM is "Gentleman's Pipe" - I've got errors in MySQL:

 

 

: DB error - 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 's Pipe'' at line 1

 

Can you help me?

Link to comment
Share on other sites

2 answers to this question

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.

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