Jump to content
UBot Underground

Insert Variables into MySQL


Recommended Posts

Database connection works fine.  INSERT, UPDATE, and SELECT work.

 

How do you take a ubot variable and plug it into the UPDATE command?  

 

I checked the wiki and there is no example of this.

Link to post
Share on other sites

In query wizard you need to enter UBot variable with curly brakcets like {#VARIABLE}.

 

Here is an example:

plugin command("DatabaseCommands.dll", "query", "SELECT * WHERE id={#VARIABLE}")

  • Like 1
Link to post
Share on other sites

Thanks, that worked great.  Not sure how to edit the Wiki, but your example should be added.

It's not actually only related to "DatabaseCommands" but curly brackets must be used every time you wan't to use variable inside string (also in set command for example).

 

However, I agree with your suggestion. I think more appropriate example would be with use of variable, since most users will want dynamic queries...

Link to post
Share on other sites

It is not recommended to edit a MySQL database directly ! can easily be hacked !

i'd suggest making an API interface to talk to the database securely!

Link to post
Share on other sites

It is not recommended to edit a MySQL database directly ! can easily be hacked !

i'd suggest making an API interface to talk to the database securely!

 

I have a php script ready (95%) to do that. It will receive commands via http post. 

And it's using secure session keys and identifiers. 

 

I think it will be available within the next week.

 

Dan

Link to post
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
Reply to this topic...

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

Loading...
×
×
  • Create New...