I am facing a problem regarding display results from a mysql table. I have a table like this in my MySql Database.
Table name - books
+----+--------------------------+--------+-------+-------+----------------+
| id | name | author | price | pages | topic |
+----+--------------------------+--------+-------+-------+----------------+
| 1 | HTML for beginners | Sanju | 200 | 400 | HTML |
| 2 | Master in JavaScript | Sanju | 300 | 500 | JavaScript |
| 3 | Object Oriented PHP | Henry | 200 | 500 | php |
| 4 | Advance AngularJS | Henry | 100 | 400 | AngularJs |
| 5 | Basic Computer Operation | Fred | 200 | 300 | Basic Computer |
| 6 | Rock the world with CSS | Henry | 400 | 500 | Css |
| 7 | Be perfect in browsers | Mark | 250 | 300 | browser |
+----+--------------------------+--------+-------+-------+----------------+
I would like to display as below.
+---------------------+---------------+-------+-----------+
| Author Name | Henry | | |
+---------------------+---------------+-------+-----------+
+-------------------------+---------------+-------+-----------+
| Book name | Price | pages | topic |
+-------------------------+---------------+-------+-----------+
| Object Oriented PHP | 200 | 500 | php |
| Advance AngularJS | 100 | 400 | AngularJs |
| Rock the world with CSS | 400 | 500 | Css |
+-------------------------+---------------+-------+-----------+
+---------------------+---------------+-------+-----------+
| Author Name | Sanju | | |
+---------------------+---------------+-------+-----------+
+----------------------+-------+-------+------------+
| Book name | Price | pages | topic |
+----------------------+-------+-------+------------+
| HTML for beginners | 200 | 400 | HTML |
| Master in JavaScript | 300 | 500 | JavaScript |
+----------------------+-------+-------+------------+
+---------------------+---------------+-------+-----------+
| Author Name | Fred | | |
+---------------------+---------------+-------+-----------+
+--------------------------+-------+-------+----------------+
| Book name | Price | pages | topic |
+--------------------------+-------+-------+----------------+
| Basic Computer Operation | 200 | 300 | Basic Computer |
+--------------------------+-------+-------+----------------+
+---------------------+---------------+-------+-----------+
| Author Name | Mark | | |
+---------------------+---------------+-------+-----------+
+------------------------+-------+-------+---------+
| Book name | Price | pages | topic |
+------------------------+-------+-------+---------+
| Be perfect in browsers | 250 | 300 | browser |
+------------------------+-------+-------+---------+
I need both php and mysql code. Thanks