mwbenavides Posted June 19, 2012 Share Posted June 19, 2012 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 More sharing options...
margaux Posted June 19, 2012 Share Posted June 19, 2012 What have you tried? The error message is telling you that the query didn't work. Have you run it in something like phpMyAdmin? Link to comment Share on other sites More sharing options...
mwbenavides Posted June 19, 2012 Author Share Posted June 19, 2012 I did run phpMyAdmin and the data tables are in tact should display the information all the login info has been tested ran a similar dummy code with success wrote new tables and re-wrote the code for a second time Link to comment Share on other sites More sharing options...
Larry Posted June 20, 2012 Share Posted June 20, 2012 By the way, this book does assume complete comfort with PHP and MySQL. Link to comment Share on other sites More sharing options...
mwbenavides Posted June 24, 2012 Author Share Posted June 24, 2012 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 More sharing options...
Larry Posted June 25, 2012 Share Posted June 25, 2012 I see. Glad it's working now and thanks for the nice words on the book. It is appreciated. Let us know if you have more questions. Link to comment Share on other sites More sharing options...
Recommended Posts