• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua/mysql select isnt working...

Basboy7

New Member
Joined
Mar 24, 2008
Messages
21
Reaction score
0
Hey all, i am trying to make a script that shows u when u have a new message on the website when u login.

Ive made this:

PHP:
        local rows = assert(con:execute("SELECT * FROM `site_messages` WHERE `to_player` = " .. getPlayerGUID(cid) .. " AND `readed` = 0;"))

	if (rows:numrows() > 0) then	
	 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You've got "..rows:numRows().." unreaded messages, please go to our website kybia.com to read them!")
	end

But I got much errors and i think this isnt working for TFS 3.0, who can help me :D?
 
PHP:
local rows = db.executeQuery("SELECT * FROM `site_messages` WHERE `to_player` = " .. getPlayerGUID(cid) .. " AND `readed` = 0;"))

    if (rows:numrows() > 0) then     
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You've got "..rows:numRows().." unreaded messages, please go to our website kybia.com to read them!") 
    end

I really don't know :D maybe this one:

PHP:
local rows = db.executeQuery("SELECT * FROM `site_messages` WHERE `to_player` = " .. getPlayerGUID(cid) .. " AND `readed` = 0;"))

    if rows > 0 then     
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You've got "..rows.." unreaded messages, please go to our website kybia.com to read them!") 
    end

numRows it's standart function?
 
Back
Top