Jump to content

MYSQL problem when trigerring events... HELP!


ElZafire

Recommended Posts

I create functions for take a mysql data, but it didnt works, i try using outputChatbox and it is in BLANK dont take the data from mysql but i dont take errors when i use it in game, here is my code...

Client Side:

function dataMysql(table, camp, where, equal, result) 
    if (not result) then 
        triggerServerEvent("dataMysql", getLocalPlayer(), table, camp, where, equal) 
    else 
        return result 
    end 
end 
addEvent("dataMysql", true) 
addEventHandler("dataMysql", getRootElement(), dataMysql) 

Server Side:

function dataMysql(table, camp, where, equal) 
    local query = mysql_query(mysql_con, "SELECT * FROM ".. table .." where ".. where .."='".. equal.."'") 
    local row = mysql_fetch_assoc(query)     
    if(row) then 
        triggerClientEvent("dataMysql", getRootElement(), table, camp, where, equal, row[camp]) 
    end 
end 
addEvent("dataMysql", true) 
addEventHandler("datoMysql", getRootElement(), dataMysql) 

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