gokalpfirat Posted August 27, 2012 Share 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. Link to comment
gokalpfirat Posted August 27, 2012 Author Share Posted August 27, 2012 Hmm no one knows how to fix? Link to comment
Castillo Posted August 27, 2012 Share Posted August 27, 2012 Are you sure "c1" is returning: true or false? Link to comment
gokalpfirat Posted August 27, 2012 Author Share Posted August 27, 2012 I dont know but when I use command it says in debug script "You can create an acc" Link to comment
Castillo Posted August 27, 2012 Share Posted August 27, 2012 Oh, so the problem is that is not inserting the account? Link to comment
gokalpfirat Posted August 27, 2012 Author Share Posted August 27, 2012 Nope but it isnt inserting too? Link to comment
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