I am trying to display and later amend the data inserted into this database on my web page. But the data is not displaying. I corrected my mistakes from my previous post and tried to troubleshoot. I believe the connection to the database is working because I am able to insert data into the database.
/*top of page invites.php*/
<?php
include("LoginRegistrationSystem/connect.php");
include("guestlist.php");
include("functions.php");
if(logged_in())
{
?>
/*in invites.php*/
<?php
$sql = "SELECT fname, lname, email, contact FROM guestlist";
$resultset = mysqli_query($con, $sql) or die("database error:".
mysqli_error($con));
echo "<table border="2">
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Contact</th>
<th>Invitation</th>
</tr>";
while($row = mysqli_fetch_array($resultset))
{
echo "<tr>";
echo"<td>" . $row['fname'] . "</td>";
echo"<td>" . $row['lname']. "</td>";
echo"<td>" . $row['email']. "</td>";
echo"<td>" . $row['contact']. "</td>";
echo "<tr>";
}
echo "</table>";
mysqli_close($con);
?>
/*LoginRegistrationSystem/connect.php*/
<?php
$con = mysqli_connect("localhost","root","","registration");
if(mysqli_connect_errno())
{
echo "Error occured while connecting with database
".mysqli_connect_errno();
}
session_start();
?>