Updating Car [Mysql]
#1

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.
Reply
#2

show us the mysql logs
Reply
#3

Try useing
mysql_debug(1);
on gamemodeinit

and then check mysql log for errors ?
Reply
#4

yes debug mysql.
Reply
#5

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.
Reply
#6

Use
mysql_debug(1);
on gamemodeinit

The log can be found in the main/root directory, where the server.cfg etc is located too.
Reply
#7

in your samp folder under "mysql_log.txt"
Reply
#8

I think he uses g-stylezz plugin, that usees mysql_query, but we will see
Reply
#9

There should be "Car Dealer" right? .. thanks for showing me the debug option!
Reply
#10

I think cardealer will work because I uses for my houses system the owner: For Sale!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)