PDA

View Full Version : Problem when installing product


Satviewers
02-25-2010, 12:48 AM
In the product xml I have :
$db->query_write("
CREATE TABLE " . TABLE_PREFIX . "osc_address_format (
address_format_id int NOT NULL auto_increment,
address_format varchar(128) NOT NULL,
address_summary varchar(48) NOT NULL,
PRIMARY KEY (address_format_id))
");

$db->query_write("INSERT INTO " . TABLE_PREFIX . "osc_address_format VALUES (1, '$firstname $lastname$cr$streets$cr$city, $postcode$cr$statecomma$country','$city / $country')");




Why doesn't it like the $.

Instead of inserting it into the database like
(1, '$firstname $lastname$cr$streets$cr$city, $postcode$cr$statecomma$country', '$city / $country')

It is showing as:
(1, ' , ', ' / ')

How can I get it to work correctly.

Thanks.

Satviewers
02-26-2010, 02:24 PM
Someone must have an answer to this.

Lynne
02-26-2010, 06:11 PM
Are those variable defined? And you probably need to do something along the lines of:
$db->query_write("INSERT INTO " . TABLE_PREFIX . "osc_address_format VALUES ('1', '".$firstname $lastname$cr$streets$cr$city, $postcode$cr$statecomma$country."','".$city / $country."')");

Satviewers
02-26-2010, 08:17 PM
Are those variable defined? And you probably need to do something along the lines of:
$db->query_write("INSERT INTO " . TABLE_PREFIX . "osc_address_format VALUES ('1', '".$firstname $lastname$cr$streets$cr$city, $postcode$cr$statecomma$country."','".$city / $country."')");

Hi,

Tried that and it gives this error when installing the plugin:

Parse error: syntax error, unexpected T_VARIABLE in /var/www/html/test/vb4/includes/adminfunctions_plugin.php(450) : eval()'d code online 605

They are defined in the app.

They should look like this in the database.
http://itvault.com/db.jpg