Printing All Entries in A PHP Table

Posted by mgunawan on Stack Overflow See other posts from Stack Overflow or by mgunawan
Published on 2014-06-11T03:15:52Z Indexed on 2014/06/11 3:25 UTC
Read the original article Hit count: 209

Filed under:
|
|
|
|

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!

© Stack Overflow or respective owner

Related posts about php

Related posts about html