Jump to content
Larry Ullman's Book Forums

Error Creating Category List


Recommended Posts

I'm getting this error when trying to create the category links in part two in the dynamics of the footer.html file:

 

An error occurred in the script '/hermes/bosweb/web037/b372/ipg.mbenavides/testing/INCLUDES/footer.html' on 43:

 

Array

(

[0] => Array

(

[function] => my_error_handler

[args] => Array

(

[0] => 2

[1] => mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given

 

 

 

this is the code I'm using per the book:

 

 

<?php

$q = 'SELECT * FROM categories ORDER BY category';

$r = mysqli_query($dbc, $q);

while (list($id, $category) = mysqli_fetch_array($r, MYSQLI_NUM)) {

echo '<li><a href="category.php?id=' . $id . '" title="' . $category . '">' . $category . '</a></li>';

}

?>

 

 

I have tried a ton of stuff to correct this, any suggestions?

Link to comment
Share on other sites

my mistake, as it turns out i was using depreciated code to attempt to write information to the tables, the error was corrected by the following:

 

$query=sprintf("querystring");

 

thanks for the help!

 

and Larry I am quite comfortable with php but I do have a condition that sometimes keeps me from completing a thought, I have failed at much less! Great book by the way!

Link to comment
Share on other sites

 Share

×
×
  • Create New...