How to retrieve data from database whenever select in drop down list in php
Ngày đăng:
10/11/2021
Trả lời:
0
Lượt xem:
97
Hello! I just started learning PHP and MYSQL a few weeks ago and Im having a little trouble. Im trying to display data from my database when a user selects an option from a drop-down list. I was able to display an error if the user made no selection, then I added more code to query the database and I started receiving errors once I made a selection. Ive been working on this for a couple of days now and I have ran out of ideas. Any help would be greatly appreciated! Thank you! HTML Option 1: Select a field to display current book inventory OR Option 2: Select an author to display his/her booksPHP Could not execute query! " ); die( mysqli_error() . "" ); } // end if else { echo "" . $error . " "; } } ?> " ); foreach ( $row as $value ) print( "" ); print( "" ); } } else { echo "No results returned."; } //Release the returned data to free mysql resources mysqli_free_result($result); mysqli_free_result($inventory); mysqli_free_result($author); //Close the database connection: mysqli_close( $dbConnection ); ?> No Query Selected"; } ?> $value |