PDA

View Full Version : Install Code Help


Twilkey
11-22-2007, 04:26 AM
I am working on a mod and I am having trouble with install code. For some reason it wont alter the user table and it wont create a new table.

<installcode><![CDATA[$query = "ALTER TABLE ". TABLE_PREFIX . "user ADD imagewtf_url integer default 250";
$db->query($query);

$query = "CREATE TABLE imagewtf_settings (settingid integer NOT NULL PRIMARY KEY auto_increment,
settingname text, switch1 integer, switch2 text)";
$db->query($query);

$query = "INSERT INTO imagewtf_settings (settingname, switch1, switch2) VALUES ('imagewtfactive', 1, NULL)";
$db->query($query);
$query = "INSERT INTO imagewtf_settings (settingname, switch1, switch2) VALUES ('allowedusergroups', 0, '2, 5, 6, 7')";
$db->query($query);]]>
</installcode>


My Table Prefix in my config file was left blank. When I tried to edit it, my whole forum went down until I change it back.

Andrew Green
11-22-2007, 01:19 PM
$query = "ALTER TABLE ". TABLE_PREFIX . "user ADD COLUMN imagewtf_url integer default 250";

Looks like you're editing a xml file directly though, under products -> Edit Products, install code goes under there.