Line 1 to 3: Database Connection and the database name is “publisher”.
Line 8: mysql_query function display the data from all the rows in table “books”. And all the data is handed over to the variable $books_query.
Line 9: mysql_query function returns the records with the help of variable “$books_query”. Here, the variable “$books_query” is a variable containing MySQL query “select * from books”.
Line 12: $books_rows[‘BookID’] gets the BookID from database attribute name as “BookID” as shown below in database view.
Line 12, 13: “BookID” and “BookTitleAttribute” are the attributes of the database table.
Database view in PHP Myadmin
Code of view of records in the database table in PHP with using MySQLi.