Jump to content

MySQL Serial


Snoowy

Recommended Posts

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)
	

Link to comment
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

Link to comment
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.

Link to comment

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