21.12.2014, 23:08
Weird.
It should work.
Make sure you have your variables set to what you use in the query, for example if you use '%s' for Username make sure that you actually set a string to Username.
And make sure that in the database it's the same.
I have also had that problem like yours but I just use the code like the above one I gave you and just change it if anything like that occurs.
Here's a code out of my script to show you that how I wrote it is actually (Supposed to be) working:
You see? I've bassicly did the same thing, therefore I am telling you to re-check on the stuff surrounding it the query and not the query itself.
(Btw, I am talking about the part where I wrote 1239 and not entered a variable of some sort)
It should work.
Make sure you have your variables set to what you use in the query, for example if you use '%s' for Username make sure that you actually set a string to Username.
And make sure that in the database it's the same.
I have also had that problem like yours but I just use the code like the above one I gave you and just change it if anything like that occurs.
Here's a code out of my script to show you that how I wrote it is actually (Supposed to be) working:
pawn Код:
mysql_format(dbHandle, query, sizeof(query), "INSERT INTO `dealerships` (`DsLocX`, `DsLocY`, `DsLocZ`, `DsIcon`) VALUES (%f, %f, %f, %d)", x, y, z, 1239);
mysql_tquery(dbHandle, query);
(Btw, I am talking about the part where I wrote 1239 and not entered a variable of some sort)