php // Call the DB connection function, mysqli_connect.php require_once ('includes/mysqli connect.php') ; // Create a query to retrieve all records $query = "SELECT * FROM bookmark"; $result = @mysqli_query ($dbc, $query) ; $num = mysqli_num_rows ($result) ; if ($num > 0) { // if there is any record, display all records echo "
There are $num records
"; // print out all records while ($row = mysqli_fetch_array ($result, MYSQLI_ASSOC) ) { echo "Title: $row[title]
";
echo "Comment: $row [comment]
";
echo "URL: $row[url]
There is no record
"; mysqli_close ($dbc) ; // close the DB connection ?>