View Full Version : Product Install Problem
1Unreal
07-25-2009, 07:29 PM
Ive got an install code on a product which looks like this
$db->hide_errors();
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "user ADD column VARCHAR(100) NOT NULL");
$db->show_errors();
But it just does nothing
Lynne
07-25-2009, 08:38 PM
If this is a problem with a modification, then you need to post in the modification thread for help. If this is a product you are writing yourself, then you should get rid of the hid_errors line for debugging purposes to see what error is occuring.
1Unreal
07-25-2009, 08:49 PM
Its my own and ive tried that already.
Lynne
07-25-2009, 08:52 PM
Have you tried giving it another name besides 'column'? I wonder if that is a field name not allowed for a new column in a table.
1Unreal
07-25-2009, 09:17 PM
Its not called column I just changed it for the examples sake
Paul M
07-25-2009, 10:21 PM
It must do something, either you get an error, or the column gets added, it cannot do nothing.
Assuming of course that its being run in the first place, are you sure that happens ?
1Unreal
07-26-2009, 12:34 AM
I uploaded it onto a different forum and it worked. Not sure why it didn't on my test board.
Dismounted
07-26-2009, 05:34 AM
Get rid of the "hide_errors()" call to display the errors.
Marco van Herwaarden
07-27-2009, 08:24 AM
Its not called column I just changed it for the examples sake
If you give examples that are different then the real issue, then how do you think we can help?
sebaot
07-27-2009, 07:05 PM
Maybe there's some prefix on the tables and you need to add ` in the statement, like:
$db->hide_errors();
$db->query_write("ALTER TABLE `" . TABLE_PREFIX . "user` ADD column VARCHAR(100) NOT NULL");
$db->show_errors();
Marco van Herwaarden
07-28-2009, 02:20 PM
Backtick is not needed to use table prefixes.
sebaot
07-29-2009, 07:52 AM
Backtick is not needed to use table prefixes.
Just trying to give suggestions, dude. <comment removed>
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.