Hello There,
I've spent hours searching forums and google for an answer but can't figure this out at all. I'm trying to add info from a 'master' db of mine such as ingredients, directions, warnings etc to the product_info _display page. This worked on my old oscommerce stores but have since upgraded to zen cart but tying sku from my db to products_model just isn't working. For example sku 89147=products_model 89147. In oscommerce i wrote this:
PHP Code:
$mysql_host = "localhost";
$mysql_db = "???";
$mysql_user = "???";
$mysql_pass = "???";
$sku = $product_info['products_model'];
$host1 = mysql_connect($mysql_host, $mysql_user, $mysql_pass) or die(mysql_error());
$result1 = mysql_query("SELECT ingredients, directions, warning, ailments FROM wholisti_main.product WHERE sku = '".$sku."'", $host1) or die(mysql_error());
while ($row = mysql_fetch_array($result1)) {
$ingredients = $row['ingredients'];
$directions = $row['directions'];
$warning = $row['warning'];
$ailments = $row['ailments'];
}
if (!empty($ingredients) ) {
echo "";
}
else {
echo "<br><br><b>Ingredients:</b> ".$ingredients."";
}
but when inserting this code into zen cart the data was not outputted. i've realized that my problem lies with:
Code:
$sku = $product_info['products_model'];
I've tried everything i could think of
PHP Code:
$sku = $products_model;
$sku = $product_info['products_model'];
$sku = $products->fields['products_model'];
to get it to work but with no success. Can you help me?
if you go to http://www.herbshopconnection.com/ch...100-ct-28.html you can see that the word ingredients is showing but the info from my other database.
thanks so much for any help you can give me.