Ian Hunt Posted August 22, 2017 Share Posted August 22, 2017 Hi, I am building a website that holds cats for sale. I have a page that lists the cats but then I want to go to a page where there is more details about the cat via a link that shows the cats name. It seems to work in principle and it takes you to the page associated with that cat. However I get this error:- Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in (then goes on to state the page name and line where the error is). Here is my code:- CIN is Cat Idenfication Name <?phpif (isset($_GET['CIN']) && is_string($_GET['CIN']) )// Define the display kitten details query:$query = "SELECT * FROM tbl_kittens_for_sale WHERE CIN={$_GET['CIN']}";$display_kitten_details_result = mysqli_query($dbc, $query); // Run the query.$rs_display_kitten_details = mysqli_fetch_array($display_kitten_details_result);?> Any help would be much appreciated. Thanks Link to comment Share on other sites More sharing options...
Ian Hunt Posted August 29, 2017 Author Share Posted August 29, 2017 Hi Guys, Any ideas on this for me. Regards Link to comment Share on other sites More sharing options...
Larry Posted September 1, 2017 Share Posted September 1, 2017 Sorry for the delayed reply! It looks like it might be correct, although it'd be much better if you verified that $_GET['CIN'] was an integer greater than 0. I'd use the standard PHP-MySQL debugging approach here: print out the query being run and run it using another interface to see the results or error. Link to comment Share on other sites More sharing options...
Recommended Posts