iDollarsteam 13 Posted December 9, 2012 Report Share Posted December 9, 2012 Hi! I want to store my users and their license codes in a database and then make the bot check the database to see if that user exists and save the result in a variable (or a table). I have made the bot that will let me input data in the database but I have problems making the client bot read the database to see if that record exists. If I use MySQL Workbench to send that query it works as it should so the sintax is correct , the problem is when I run it in ubot, I get an error: "Fatal error encountered during command execution" and of course the command does not return any value. here is the script: ui text box("id", #hdid) clear table(&keyword) plugin command("DatabaseCommands.dll", "connect to database", "server=*******;uid=*******; pwd=******; database=******; port=3306; pooling=false") { plugin command("DatabaseCommands.dll", "query with results", "SELECT * FROM user_data WHERE user_HDID=@{#hdid}", &keyword) if($comparison($table total rows(&keyword), ">", 0)) { then { alert("License valid") } else { alert("License invalid") } } } (database credentials are "******" here for obvious reasons ) ) Can anyone tell me what is wrong with this code or show me how to do that in another way?Thank You Quote Link to post Share on other sites
iDollarsteam 13 Posted December 9, 2012 Author Report Share Posted December 9, 2012 ok, I solved it ... the variable in the query should be inserted in a different way: ui text box("id", #hdid) clear table(&keyword) plugin command("DatabaseCommands.dll", "connect to database", "server=******;uid=*******; pwd=*******; database=*******; port=3306; pooling=false") { plugin command("DatabaseCommands.dll", "query with results", "SELECT * FROM user_data WHERE user_HDID=\"{#hdid}\"", &keyword) if($comparison($table total rows(&keyword), ">", 0)) { then { alert("License valid") } else { alert("License invalid") } } } Quote Link to post Share on other sites
blumi40 222 Posted December 9, 2012 Report Share Posted December 9, 2012 tipp!as more fields u request as more secure is the licencething if ya script only check for id it is mutch easyer to crack itdo something like....select pla from plupp where id = #id AND email =#email AND some_other_data = #some_other_date...is a bit more secure 1 Quote Link to post Share on other sites
iDollarsteam 13 Posted December 10, 2012 Author Report Share Posted December 10, 2012 yes, and I also use for the connection a user that has only select and display privileges on the database Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted December 10, 2012 Report Share Posted December 10, 2012 could even include in randomized session keys. that must be present inorder to run 1 Quote Link to post Share on other sites
iDollarsteam 13 Posted December 10, 2012 Author Report Share Posted December 10, 2012 TJ... you are waaay ahead as always... This is a great idea! Thanks ... Quote Link to post Share on other sites
Aymen 385 Posted January 10, 2013 Report Share Posted January 10, 2013 hey sorry to post to an old thread but , what server host should i use when trying to connect to a database ?? seems that i'm getting alot of fails Quote Link to post Share on other sites
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.