Log in

View Full Version : whats wrong with this un/install code?


BigJohnny
11-05-2008, 12:56 AM
i cant seem to figure out why this doesnt work..... but i keep getting the error that there is an error in my sql syntax....

If i remove IF EXISTS then i get the error that the column doesnt exist (because it doesnt yet)

how do i fix this.... ive read through some sql stuff but nothing i tried fixed it.

INSTALL CODE

$db->query_write("ALTER TABLE user ADD timeonboard INT(10) NOT NULL AFTER lastactivity") ;

UNINSTALL CODE

$db->query_write("ALTER TABLE user DROP IF EXISTS timeonboard");

Dismounted
11-05-2008, 05:16 AM
You can't actually "DROP IF EXISTS" IIRC. It just doesn't exist.