Albert, All
Thank you for creating this download, it makes life a lot easier when your migrating from OSC to Zen
I have successfully used Albert's latest iteration of the contribution and am now trying to add in manufacturers and also the meta tags for categories and products.
Both pieces of code complain about the same error. Taking the manufacturers code;
importing manufacturersYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 6
I have banged this about for several hours and cannot see what I am doing wrong. It is probably a minor item but...
I would be very grateful for any suggestions as to where to take this
Below is the code for taking the data out of OSC
Code:
$query_manufacturers = "SELECT * FROM " . $source_db_table_prefix . "manufacturers";
$manufacturers = mysql_query($query_manufacturers);
$i = 0;
echo 'exporting manufacturers';
while ($export_record = mysql_fetch_assoc($manufacturers)) {
$import_manufacturers[$i]['manufacturers_id'] = mysql_real_escape_string($export_record['manufacturers_id']);
$import_manufacturers[$i]['manufacturers_name'] = mysql_real_escape_string($export_record['manufacturers_name']);
$import_manufacturers[$i]['manufacturers_image'] = mysql_real_escape_string($export_record['manufacturers_image']);
$import_manufacturers[$i]['date_added'] = mysql_real_escape_string($export_record['date_added']);
$import_manufacturers[$i]['last_modified'] = mysql_real_escape_string($export_record['last_modified']);
$i++;
echo '.';
}
mysql_free_result($manufacturers);
And this is the code for putting into Zen
Code:
echo 'importing manufacturers';
mysql_query("TRUNCATE `" . $target_db_table_prefix . "manufacturers`");
while (list($i, ) = each($import_manufacturers)) {
$insert_manufacturers = "INSERT INTO " . $target_db_table_prefix . "manufacturers SET
manufacturers_id = '" . $import_customer[$i]['manufacturers_id'] . "',
manufacturers_name = '" . $import_customer[$i]['manufacturers_name'] . "',
manufacturers_image = '" . $import_customer[$i]['manufacturers_image'] . "',
date_added = '" . $import_customer[$i]['date_added'] . "',
last_modified = '" . $import_customer[$i]['last_modified'] . "',
";
$success = mysql_query($insert_manufacturers);
if (!$success) { echo mysql_error(); exit;}
echo '.';
}
Thank you
A very perplexed Centec2b