Skip to content Skip to sidebar Skip to footer

Data From Database Not Appearing In Table On Html Site

I have a form that keys in the contacts of the guest list. On the same page itself after the submit button is keyed I want to retrieve the data and display the list of guest. The d

Solution 1:

First, you do not need to repeat include("guestlist_connect.php"); And also you forgot to end while loop

  <?php 
    include("guestlist.php");
     include("guestlist_connect.php"); 
    ?> 
    /*invites.HTML*/ 
    <h2 >Invites & Guest List</h2> 
    <table border="2"> 
    <thead> 
    <tr> 
    <th>First Name</th> 
    <th>Last Name</th> 
    <th>Contact</th> 
    <th>Invitation</th> 
    </tr> 
    </thead> <tbody> 
    <?php 
    $result = mysql_query("SELECT * FROM guestlist"); 
    while( $row = mysql_fetch_assoc( $result ) ){ ?> 
    <tr> 
    <td><? php echo $row["fname"]; ?></td> 
    <td><? php echo $row["lname"]; ?></td> 
    <td><? php echo $row["email"]; ?></td> 
    <td><? php echo $row["contact"]; ?></td> 
    </tr>
     <?php } ?> // you forgot to end a while loop
    </tbody> </table> 
    <?php mysql_close($connector); ?> 
    </div><!--End Rightcontainer--> </div>

Post a Comment for "Data From Database Not Appearing In Table On Html Site"