MySQL Insert Query Problem
#1

I'm new to BlueG's mysql and i'm using the R5 version of it. I created an insert query to input some things but it wont work. I dont think theres any error.

When i use "SET" instead of "VALUES" ,like this:

Код:
new query[50],pass[50],pName[50];
GetPlayerName(playerid,pName,30);
mysql_real_escape_string(inputtext,pass);
format(query,sizeof(query),"INSERT INTO Users SET Username='%s',Password='%s',Money=10000",pName,pass);
mysql_query(query);
SendClientMessage(playerid,COLOR_YELLOW,"Successfully Registered");
GivePlayerMoney(playerid,10000);
I get this in debug:

Код:
[13:17:45] CMySQLHandler::Query(INSERT INTO Users SET Username='Ron_Killings',Pas) - An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1)
And When i use "VALUES" ,like this:

Код:
format(query,sizeof(query),"INSERT INTO Users VALUES ('%s','%s',1000)",pName,pass);
I get this:

Код:
[13:29:10] CMySQLHandler::Query(INSERT INTO Users VALUES('Ron_Killings','main',10) - An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1)
Any help?
Reply


Messages In This Thread
MySQL Insert Query Problem - by Minion - 16.07.2012, 07:48
Re: MySQL Insert Query Problem - by Ballu Miaa - 16.07.2012, 07:51
Re: MySQL Insert Query Problem - by Minion - 16.07.2012, 07:54
Re: MySQL Insert Query Problem - by BaubaS - 16.07.2012, 07:56
Re: MySQL Insert Query Problem - by Ballu Miaa - 16.07.2012, 07:56
Re: MySQL Insert Query Problem - by Minion - 16.07.2012, 08:00
Re: MySQL Insert Query Problem - by BaubaS - 16.07.2012, 08:03
Re: MySQL Insert Query Problem - by Minion - 16.07.2012, 08:23
Re: MySQL Insert Query Problem - by BaubaS - 16.07.2012, 08:26
Re: MySQL Insert Query Problem - by Minion - 16.07.2012, 08:29

Forum Jump:


Users browsing this thread: 1 Guest(s)