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

    hi!
    according to the error message: perhaps its just a spelling error?
    perhaps denny_categories instead of denny_catagories or something..

      thanks for the response.

      all spellings match in mysql and php. Another note, the site has been up for years and now all of a sudden it decideds to do this? ive asked the hosts if they can look into it.

      site is www.wfdenny.co.uk

        Write a Reply...