Jump to content
  • 0

Problem with query_sql


Edwardlol

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   0
  • Joined:  07/26/12
  • Last Seen:  

I'm having a problem with this:

 

 

 

input .@amigo1$;
            query_sql "SELECT online FROM `char` WHERE name = " +.@amigo1$,.@amigo1[0];
 

The script load without problems but when I test it and for example write "test" in .@amigo1$ it happen:

 

http://imageshack.us/photo/my-images/10/sinttulokui.png/

 

I hope you can help :/

Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   0
  • Joined:  07/26/12
  • Last Seen:  

That send me a db bug when I write "test" in to the input.

 

http://imageshack.us/photo/my-images/547/sinttuloqlp.png/

 

input .@amigo1$;
			query_sql "SELECT online FROM `char` WHERE `name` = "+.@amigo1$,.@amigo1[0];

 

 

And I have that.

 

 

EDIT: I put 

query_sql "SELECT online FROM `char` WHERE `name` = "+"'"+.@amigo1$+"'",.@amigo1[0];

 

 And then it work, very thank you :)

Edited by Edwardlol
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  60
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   219
  • Joined:  11/22/11
  • Last Seen:  

`name` is char style, you need to make searching like this

 

`name` = '<string>'
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   0
  • Joined:  07/26/12
  • Last Seen:  

I don't understand it :/ Can you make a example with my data?

 

I put query_sql "SELECT online FROM `char` WHERE `name` = " +.@amigo1$,.@amigo1[0]; and still got the same error.

Edited by Edwardlol
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   0
  • Joined:  07/26/12
  • Last Seen:  

`name` = 'test'

 

I can't type '.@amigo1$' :/

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  60
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   219
  • Joined:  11/22/11
  • Last Seen:  

are your player named ".@amigo1$"?

you said he is "test" in #1

Edited by goddameit
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   0
  • Joined:  07/26/12
  • Last Seen:  

There is a input .@amigo1$;

 

I want to SELECT that variable in to my query_sql

Edited by Edwardlol
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  60
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   219
  • Joined:  11/22/11
  • Last Seen:  

so? problem in where?
 
I said you need to make searching like this
 

`name` = '<string>'


 
if you don't know how to insert variable, read how you did in #1
 

WHERE name = " +.@amigo1$
Edited by goddameit
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...