Printing All Entries in A PHP Table
- by mgunawan
I'm trying to insert a php excerpt with SQL (I understand this is outdated, but am trying to grasp the syntax first) into my HTML page, and I've got the following table:
ID Name Element1 Element2
0 John John's 1st John's 2nd
1 Bill Bill's 1st Bill's 2nd
2 Steve Steven's 1st Steve's 2nd
I'm trying to get the for loop that will essentially print out the following in my html page
Name: Name where ID=0
Element1: Element1 where ID=0
Element2: Element2 where ID=0
Name: Name where ID=1
Element1: Element1 where ID=1
Element2: Element2 where ID=1
and so forth. Basically, I am trying to make this process automated so that whenever a new record is added into the table, the HTML page will automatically update with a new "profile".
Thank you for your help!