[MySQL] Problem with vehicle's saving. -
Flatron - 13.07.2011
Hello everyone.
Here is the problem.
I maked the owner car saving system with mysql, but it's not working.
Ant first was errors with mysql, i found errors on mysql_log.txt file, then i repaired.
When i bough the car, i seating in driver position, and typing "/spos" - /spos - command to save vehicle.
Then i cheking mysql_log.txt file, and in there is writing :
"Successfully executed."
It means, successfully saved i think so.
But, when i cheking my sql tables, and when i want to see, did saved or not, so tables is empty.
Not saved.
My script is good, with him - no errors.
I dont know what to do, maybe someone can help for me ?
Saving callback with script:
Код:
public SaveVehicleData(playerid)
{
new query[300];
new Float:VCoo[4],Float:HP;
GetVehiclePos(pirktamas,VCoo[0],VCoo[1],VCoo[2]);
GetVehicleHealth(pirktamas,HP);
GetVehicleZAngle(pirktamas,VCoo[3]);
GetPlayerName(playerid,vehicleDB[pirktamas][savininkas],MAX_PLAYER_NAME);
format(query,sizeof(query),"UPDATE `masinos` SET \
`Model`=%d,\
`Uzraktas`=%d,\
`Interior`=%d,\
`X`=%f,\
`Y`=%f,\
`Z`=%f,\
`Angle`=%f,\
`HP`=%f,\
`Degalai`=%d,\
`Spalva1`=%d,\
`Spalva2`=%d,\
`Paintjob`=%d WHERE (`Savininkas`='%s')",
GetVehicleModel(pirktamas), // Modelis
vehicleDB[pirktamas][locked], // Uzraktas
GetVehicleVirtualWorld(pirktamas), // Interior
VCoo[0],VCoo[1],VCoo[2], // X, Y, Z
VCoo[3], // Angle (Rotation)
HP, // HP
vehicleDB[pirktamas][gas], // Degalai
vehicleDB[pirktamas][Spalva1], // Spalva 1
vehicleDB[pirktamas][Spalva2], // Spalva 2
vehicleDB[pirktamas][Paintjob], // Paintjob'as
vehicleDB[pirktamas][savininkas]); // Savininkas
mysql_query(query);
}
My SQL db table screen is :
[img width=700 height=564]http://www.part.lt/img/5e3428630f16202bbb83b950e631262d51.JPG[/img]
And this is not saving, and tables not updating.
I'll be very glad, if someone help for me about this question.
Sorry for my english..
Re: [MySQL] Problem with vehicle's saving. -
Medo - 13.07.2011
You might not get help with MY-SQL No much users.