MYSQL Table deleting problem
#1

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

change the %i to %d
Reply
#3

umn.. not work..
Reply
#4

Topeltposti -||- Any ideas?
Reply
#5

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;
}
Reply
#6

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

OK, i will try something else, but thanks XIII.
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)