Updating Car [Mysql] - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Updating Car [Mysql] (
/showthread.php?tid=168074)
Updating Car [Mysql] -
Cameltoe - 14.08.2010
Hello, iv'e been converting my gm to use mysql instead of flatfiles.
Everything is working perfect except this Car function.
pawn Код:
public UpdateCar(vehicleid)
{
new string[256];
if(Model != 0)
{
format(string, sizeof(string), "UPDATE cars SET model=%d, owner=%s, color1=%d, color2=%d, price=%d, locked=%d, x=%f, y=%f, z=%f, a=%f WHERE id ='%d'",Model,Owner,Color1,Color2,Price,Locked,X,Y,Z,A,vehicleid);
mysql_query(string);
printf("ID: %d - Model: %d - Owner: %s",vehicleid,Model,Owner);
printf("Query: %s",string);
}
else
{
}
}
I always debug with print, and i can clearly see that the String gets formated.
heres an ss:
Can't see why the row dosn't get updates.
EDIT [FIX]:
Changing owner=%s to owner='%s' Fixed this shit

thanks for helping.
Re: Updating Car [Mysql] -
armyoftwo - 14.08.2010
show us the mysql logs
Re: Updating Car [Mysql] -
superelite1 - 14.08.2010
Try useing
mysql_debug(1);
on gamemodeinit
and then check mysql log for errors ?
Re: Updating Car [Mysql] -
DiddyBop - 14.08.2010
yes debug mysql.
Re: Updating Car [Mysql] -
Cameltoe - 14.08.2010
Quote:
Originally Posted by armyoftwo
show us the mysql logs
|
where's the log located?
EDIT:
i'll check with mysql_debug(1); didnt really know of that.
Re: Updating Car [Mysql] -
superelite1 - 14.08.2010
Use
mysql_debug(1);
on gamemodeinit
The log can be found in the main/root directory, where the server.cfg etc is located too.
Re: Updating Car [Mysql] -
DiddyBop - 14.08.2010
in your samp folder under "mysql_log.txt"
Re: Updating Car [Mysql] -
superelite1 - 14.08.2010
I think he uses g-stylezz plugin, that usees mysql_query, but we will see
Re: Updating Car [Mysql] -
Cameltoe - 14.08.2010
There should be "Car Dealer" right? .. thanks for showing me the debug option!
Re: Updating Car [Mysql] -
superelite1 - 14.08.2010
I think cardealer will work

because I uses for my houses system the owner: For Sale!