ElZafire Posted April 27, 2012 Share Posted April 27, 2012 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now