MYSQL Table deleting problem - 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: MYSQL Table deleting problem (
/showthread.php?tid=192455)
MYSQL Table deleting problem -
siiml - 22.11.2010
Hey!
I have a problem with my Car system. I wan't to delete table when player write "/sellcar". It is important because car system spawns new cars after RR to the spawnpoint where player bought a car.
Here's code:
Код:
public ConvertToSQLDeleteCar(SQLID, vehid)
{
#define CAR vehicles[vehid]
new query[MAX_QUERY];
UpdateVehicleData(vehid);
format(query, sizeof(query), "DELETE FROM `absoluterp`.`vehicles` WHERE `vehicles`.`vSQLID` = %i LIMIT 1", SQLID);
mysql_query(query);
DestroyVehicle(vehid);
#undef CAR
return 1;
}
(Problem: This code don't delete a car table from MYSQL.. but i need it.)
Sorry about my english
Thanks,
Siim.
Re: MYSQL Table deleting problem -
XePloiT - 22.11.2010
change the %i to %d
Re: MYSQL Table deleting problem -
siiml - 22.11.2010
umn.. not work..
Re: MYSQL Table deleting problem -
siiml - 22.11.2010
Topeltposti -||- Any ideas?
Re: MYSQL Table deleting problem -
TheXIII - 22.11.2010
pawn Код:
public SQLDeleteCar(vehicleid)
{
new query[MAX_QUERY];
format(query, sizeof(query), "DELETE * FROM vehicles WHERE vSQLID = %i LIMIT 1", vehicles[vehicleid][vSQLID]);
mysql_query(query);
DestroyVehicle(vehicleid);
return 1;
}
Re: MYSQL Table deleting problem -
Auxxx - 22.11.2010
Why the fuck would you need to delete the cars from database anyway?
MySQL is highly advanced Structured Query Language that can store a huge ammount of data. Max players you probably get to your server is around 30 to 50 players per day and I seriously dont see a point for deleting their cars on /sell command?
Greetings from Estonia, Auxxx.
Tervitustega Eestist Siim, Auxxx.
EDIT: No need for double posts, there's a "Edit" button, as you can see
Re: MYSQL Table deleting problem -
siiml - 23.11.2010
OK, i will try something else, but thanks XIII.
Re: MYSQL Table deleting problem -
thiaZ_ - 23.11.2010
TRUNCATE
http://dev.mysql.com/doc/refman/5.1/...ate-table.html
pawn Код:
mysql_query( "TRUNCATE TABLE sometable" );
//Oh, nevermind I thought you wanted to delete the whole table.