SA-MP Forums Archive
MySQL help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL help (/showthread.php?tid=514241)



MySQL help - Vaishnav - 20.05.2014

sorry for the inconvenience again :\ but I am getting some errors in MySQL

my problem is

Код:
[21:29:17] [DEBUG] mysql_format - connection: 1, len: 128, format: "UPDATE `Accounts` SET Score=%d, Cash=%d, Level=%d, Kills=%d, Deaths=%d, pMute=%d, Warns=%d  WHERE Name=`%s`"
[21:29:17] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `Accounts` SET Score=0, Cash=0, Level=0, Kills=0, Deaths=", callback: "(null)", format: "(null)"
[21:29:17] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[21:29:17] [DEBUG] mysql_tquery - scheduling query "UPDATE `Accounts` SET Score=0, Cash=0, Level=0, Kills=0, Deaths=0, pMute=0, Warns=0  WHERE Name=`Emperror`"..
[21:29:17] [DEBUG] CMySQLQuery::Execute[()] - starting query execution
[21:29:17] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'Emperror' in 'where clause'
[21:29:17] [DEBUG] CMySQLQuery::Execute[()] - error will be triggered in OnQueryError
[21:29:17] [DEBUG] CMySQLQuery::Execute[()] - data being passed to ProcessCallbacks()
[21:29:17] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
and the code

Код:
 mysql_format(mysql, query, sizeof(query), "UPDATE `Accounts` SET Score=%d, Cash=%d, Level=%d, Kills=%d, Deaths=%d, pMute=%d, Warns=%d  WHERE Name=`%s`",\
  score,  money,  PlayerInfo[playerid][Level],  PlayerInfo[playerid][Kills],  PlayerInfo[playerid][Deaths],  PlayerInfo[playerid][muted],  PlayerInfo[playerid][Warns],  GetName(playerid));
  mysql_tquery(mysql, query, "", "");
pls someone help :\


Re: MySQL help - LemonPunch - 20.05.2014

What kind of program are you using uploading the MYSQL? XAMPP, WAMPSERVER?

Uploading it at phpmyadmin? then make a database to the right and import it onto that.


Re: MySQL help - iReacheR - 20.05.2014

pawn Код:
mysql_format(mysql, query, sizeof(query), "UPDATE `Accounts` SET `Score` = '%d', `Cash` = '%d', `Level` = '%d', `Kills` = '%d', `Deaths` = '%d', `pMute` = '%d', `Warns` = '%d'  WHERE `Name` = '%s'",\
  score,  money,  PlayerInfo[playerid][Level],  PlayerInfo[playerid][Kills],  PlayerInfo[playerid][Deaths],  PlayerInfo[playerid][muted],  PlayerInfo[playerid][Warns],  GetName(playerid));
  mysql_tquery(mysql, query, "", "");
Here this code would work.
Your code had a syntax error. The symbol ` is used for signifying names of fields, the values that are to be stored in or are to be get from a field should be in this ' symbol.

For example i meed to get a players name from a field i will write `Name` = '%s' and not 'Name' = `%s`.
I hope you understood it.


Re: MySQL help - Vaishnav - 21.05.2014

hey thanks bro it worked thank u so much +repped