Hello
Need some help got some code here (php);
<?php
/
Menu template.
**/
function navigation(){
// $output .= '<p align="right"><a href="/?'.base64_encode("method=view&ref=sale items").'">Sale Items</a></p>';
$documents = mysql_query("SELECT docid, menu_title FROM denny_documents WHERE type='standard' AND menu_title!='' ORDER BY menu_title ASC");
$output .= '<p align="right">';
$output .= '<a href="/?">Home Page</a><br clear="all" />';
while($result = mysql_fetch_object($documents)){
$output .= '<a href="/?'.base64_encode("method=doc&ref=".$result->docid).'">'.$result->menu_title.'</a><br clear="all" />';
}
$output .= '</p>';
$products = mysql_query("SELECT DISTINCT main_cat FROM denny_catagories ORDER BY main_cat ASC");
$output .= '<p align="right">';
while($result = mysql_fetch_object($products)){
$output .= '<a href="/?'.base64_encode("method=main&ref=".$result->main_cat).'">'.$result->main_cat.'</a><br clear="all" />'.chr(13);
}
$output .= '</p>';
return($output);
}
?>
The first use of the mysql_fetch_object works ($documents one). The second one however ($products) doesnt and displays the error: Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /html/nav.inc on line 21.
Im totally stuck to why it displays an error, please please help
thankyou