SA-MP Forums Archive
new query(mysql) +REP ! - 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: new query(mysql) +REP ! (/showthread.php?tid=344523)



new query(mysql) +REP ! - [BG]PREDATOR - 21.05.2012

Hello can someone explain me how it work new query old was mysq_query and new is mysql_function_query

here example that in trying to do

PHP код:
CMD:kill(playerid,params[])
{
    new 
query[256];
    
format(query,sizeof(query),"INSERT INTO `playerdata` (`username`,`password`,) VALUES (`Fear`,`123`");
    
mysql_function_query(1queryfalse,"","","");
    
SendClientMessage(playerid,-1,"test");
    return 
1;




Re: new query(mysql) +REP ! - Mandrakke - 21.05.2012

you have syntax errors on that query, try it below;

pawn Код:
format(query, sizeof(query), "INSERT INTO playerdata (username, password) VALUES ('Fear', 123)");


- edit -
If it won't work, tell which plugin you use.


Re: new query(mysql) +REP ! - doreto - 21.05.2012

edit:wrong topic im sorry


Re: new query(mysql) +REP ! - [BG]PREDATOR - 21.05.2012

i get this error when i mysql debug CMySQLHandler::ProcessQueryThread() - Error will be triggered to OnQueryError()


Re: new query(mysql) +REP ! - Mandrakke - 21.05.2012

right, paste it somewhere in to your GM and paste here the console output;

pawn Код:
public OnQueryError(errorid, error[], resultid, extraid, callback[], query[], connectionHandle)
{
    printf("%d %s %d %d %s %s %d", errorid, error, resultid, extraid, callback, query, connectionHandle);
    return 1;
}



Re: new query(mysql) +REP ! - [BG]PREDATOR - 21.05.2012

Quote:
Originally Posted by Mandrakke
Посмотреть сообщение
you have syntax errors on that query, try it below;

pawn Код:
format(query, sizeof(query), "INSERT INTO playerdata (username, password) VALUES ('Fear', 123)");


- edit -
If it won't work, tell which plugin you use.
ty very much but what have you change its same like i see can you please tell me i rep you


Re: new query(mysql) +REP ! - Mandrakke - 21.05.2012

Код:
INSERT INTO `playerdata` (`username`,`password`,) VALUES (`Fear`,`123`"
1 - there is an ")" missing after "123".
2 - there is an "," after "password" and no one field declared, this result in to an syntax error.
3 - Values cannot be placed between `, they need to be between ' or ".

I don't know how to express myself very well in english, but I think you can understand what I said.


also you don't have to rep me for this.