Mysql don't Save
#1

Hi guys, I create a Command to save my variables: " pvModel", but this variables didn't save in my db.
This is a Code
Код:
CMD:prova1(playerid,params[])
{
 	new string[256];
 	format(string, sizeof(string), "UPDATE playervehicles SET pvModel = '%d'", carVariables[playerid][pvModel]);
 	mysql_query(string);
	return 1;
}
In my db there is:
playervehicles => pvModel
Reply
#2

You need to add the second part..

pawn Код:
"WHERE Vehicleid? =%d",GetPlayerVehicleId(playerid));"
Something like that.

Here's a small guideline..

pawn Код:
format(save, sizeof(save), "UPDATE Tablename SET whateveryouwant to save = %d  WHERE Top field that gets the whole thing, such as vehicleid = %d",

        whateverthethingisfor %d,
        GetPlayerVehicleID(playerid) or w/e you use here.);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)