Jump to content
  • 0

Help on Query Sql


Limestone

Question


  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.03
  • Content Count:  647
  • Reputation:   16
  • Joined:  11/21/11
  • Last Seen:  

hi how can I randomly set cash point to my account using query_sql?

 

example:

query_sql ("UPDATE `cash` SET `cash_point` = cash_point + rand(100,1000) WHERE `account_id` = '"+getcharid(3)+"'");

 

if i use the item, this is the error. DB error - Operand should contain 1 column(s)

 

Thanks!

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

I suggest you use

set #CASHPOINTS, #CASHPOINTS + rand(100,1000);

Instead of doing an sql query

Edited by jezznar
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...