Hello All the code snippet below is from an osCommerce store I’m adding some extra functionality to.
It’s failing at this line [b]$thule_products_id = mysql_result($thule_products_id_query,0);
[i]
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/faster/internal/http/www1/includes/application_top.php on line 388
Warning: Cannot modify header information – headers already sent by (output started at /home/faster/internal/http/www1/includes/application_top.php:388) in /home/faster/internal/http/www1/includes/functions/general.php on line 28
Does anyone know what is going wrong, I’ve also posted on the osCommerce forum but am still awaiting a reply so thought I’d ask you guys.
Here’s the code.
[code] // customer adds a product from the Thule Database
case ‘add_product_thule’ : if (isset($HTTP_POST_VARS[‘products_model’])) {
$tule_products_model = $HTTP_POST_VARS[‘products_model’];
$thulequery=”SELECT products_id FROM products WHERE products_model = $thule_products_model”;
$thule_products_id_query = mysql_query($thulequery);
$thule_products_id = mysql_result($thule_products_id_query,0);
$cart->add_cart($thule_products_id, $cart->get_quantity(tep_get_uprid($thule_products_id, $HTTP_POST_VARS[‘id’]))+1, $HTTP_POST_VARS[‘id’]);
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
Thanks
Paul