Hello.
Im getting this error on a product page on my website
Quote
'Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/supremew/public_html/catalog/osc/products_new.php on line 89'
?>
<tr>
<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>
<!--Start JLG Disable Buy Now and Shopping Cart-->
<?php
?>
<tr>
<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>
<!--Start JLG Disable Buy Now and Shopping Cart-->
<?php
$nononline_items = array();
$sql = "SELECT products_id FROM products WHERE disable_addtobasket='Y'";
$result = mysql_query($sql);
while($id = mysql_fetch_array($result,MYSQL_ASSOC)){
array_push($nononline_items,$id['products_id']);
}
if (in_array($products_new['products_id'],$nononline_items)){
echo ("<td align=\"right\">". NON_ONLINE_ITEM ."</td>");
}
else{
echo "<td align=\"right\" valign=\"middle\" class=\"main\">";
echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>';
echo "</td>";
}
?>
<!--End JLG Disable Buy Now and Shopping Cart-->
$sql = "SELECT products_id FROM products WHERE disable_addtobasket='Y'";
$result = mysql_query($sql);
while($id = mysql_fetch_array($result,MYSQL_ASSOC)){
array_push($nononline_items,$id['products_id']);
}
if (in_array($products_new['products_id'],$nononline_items)){
echo ("<td align=\"right\">". NON_ONLINE_ITEM ."</td>");
}
else{
echo "<td align=\"right\" valign=\"middle\" class=\"main\">";
echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>';
echo "</td>";
}
?>
<!--End JLG Disable Buy Now and Shopping Cart-->
In red is line 89
Can anyone help? I really have no idea what to edit
Thanks.