Jump to content

MTA SQL register problem


Weser

Recommended Posts

Posted (edited)

Hello guys i have problem with sql check database does player exist or not 

 

 if(mysql_num_rows(dbQuery(connect, "SELECT id FROM players where username='"..editBox.."'"))) then

  outputChatBox("Not work :(")
 end

but this mysql_num_rows seems not working is there other type to check that or not?

Edited by Weser
Posted
	dbQuery( function(qh)
		local result = dbPoll( qh, 0 )
		if(result and #result > 0) then
			outputChatBox("Found")
		else
			outputChatBox("Not found")
		end
			
	end,connection, "SELECT id FROM players where username= ? LIMIT 1", username )

 

  • Like 1
Posted
1 hour ago, pa3ck said:

	dbQuery( function(qh)
		local result = dbPoll( qh, 0 )
		if(result and #result > 0) then
			outputChatBox("Found")
		else
			outputChatBox("Not found")
		end
			
	end,connection, "SELECT id FROM players where username= ? LIMIT 1", username )

 

right u can use this 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...