Rendering entire table in html
I have a mysql table containing 20 records of employees.I want to开发者_JAVA技巧 show the entire table in the html format that has been created in the page. e.g. <tr><td>table field value</td></tr>
. Can you tell me the technique.
Something like this:
- Print the initial HTML, like doctype, html, header, body, table, etc.
- Fetch the rows from the table.
- Iterate over the rows using a "foreach" loop.
- For each row, print the HTML that corresponds to that row.
- Print the final bits of HTML, like the closing tags for table, body, html.
If this sounds like gobbledygook to you, google for some "Introduction to programming" tutorials.
It's possible using only MySQL
mysql -H -e "select * from employees"
精彩评论