gokalpfirat Posted August 27, 2012 Posted August 27, 2012 handler = mysql_connect("localhost", "root", "ankara", "mtaturk") -- Establish the connection if ( not handler ) then -- The connection failed outputDebugString("Unable to connect to the MySQL server") else outputDebugString("Connected") end function kayit(player,cmd,name1,pass) name1 = tostring(name1) c1 = mysql_query(handler, "SELECT Name FROM users WHERE Name='"..name1.."'") if (c1 == true) then outputDebugString("Name already exist") else outputDebugString("You can create an acc") reg = mysql_query(handler, "INSERT INTO users(Name,Pass,Para,Puan) VALUES('"..name1.."', '"..pass.."', 0, 0 ") end mysql_free_result(c1) end addCommandHandler("kayit",kayit) This is my script I connect my mysql but when I "kayit" command I cant add accound.
Castillo Posted August 27, 2012 Posted August 27, 2012 Are you sure "c1" is returning: true or false? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
gokalpfirat Posted August 27, 2012 Author Posted August 27, 2012 I dont know but when I use command it says in debug script "You can create an acc"
Castillo Posted August 27, 2012 Posted August 27, 2012 Oh, so the problem is that is not inserting the account? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now