Jump to content

MySQL Serial


Snoowy

Recommended Posts

Posted

Hy! I started the easily script for today. The command essence the player write /getserial, get the player serial, search for MySQL data, account table, serial column, and if there are write ouputChatBox the yes, if not there are write the outputChatBox no. However command is not working, i write the command in chat, however only write yes. Please help me, and thank you for help! :)

	function serialgetme(player, command, serial)
    local pserial = getPlayerSerial(player)
    local seri = dbQuery(connection,"SELECT * FROM accounts WHERE serial = ?", pserial)
    if seri then
        outputChatBox("yes")
    else
        outputChatBox("no")
    end
end
addCommandHandler("getserial", serialgetme)
	

Posted
function getPserial (player,cmd)
local serial = getPlayerSerial(player)
local db = dbPoll( dbQuery(connection,"SELECT * FROM accounts WHERE serial = ?", serial), -1 )
for i, row (db) do 
return outputChatBox("Serial Found")
end
return outputChatBox("Serial Not Found")
end
addCommandHandler("getserial")

this will work  , try it

Posted
function getPserial (player,cmd)
	local serial = getPlayerSerial(player)
	local db = dbPoll(dbQuery(connection,"SELECT * FROM accounts WHERE serial = ?", serial), -1)
	for i, row in ipairs(db) do 
		return outputChatBox("Serial Found")
	end
	return outputChatBox("Serial Not Found")
end
addCommandHandler("getserial")

This will work.

Posted
On 15/01/2018 at 17:55, Snoowy said:

Hy! Not working, please help me.. :/

 


	server.lua:12: 'in' expected near '('
	

 

urban fixed it for u , it's will work , thx urban :v i forget it , bcs i was typing too faster

  • Like 1

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