So before someone tells me my server's PHP is not ruing, it is. When I make a .php that is just Hello World
"; ?> it works fine. However, when I use my code to construct this table... I literally get no HTML on my page source. What's going on??
bd = mysqli_coect($mysql_hostname, $mysql_user, $mysql_password, $mysql_database);
if (!$db) {
echo "Error: Unable to coect to MySQL." . PHP_EOL;
echo "Debugging ero: " . mysqli_coect_ero() . PHP_EOL;
echo "Debugging error: " . mysqli_coect_error() . PHP_EOL;
exit;
}
echo "Success: A proper coection to MySQL was made! The my_db database is great." . PHP_EOL;
echo "Host information: " . mysqli_get_host_info($link) . PHP_EOL;
$result = mysqli_query("SELECT * FROM persons"); // selecting data through mysql_query()
echo '<table border=1px>'; // opening table tag
echo'<th>Name</th><th>Email</th><th>Sametime</th><th>Phone Number</th><th>Ranking</th>'; //table headers
while($data = mysqli_fetch_array($result))
{
// we are ruing a while loop to print all the rows in a table
echo'<tr>'; // printing table row
echo '<td>'.$data['firstname'].$data['lastname'].'</td><td>'.$data['email'].'</td><td>'.$data['sametime'].'</td><td>'.$data['phone'].'</td><td>'.$data['ranking'].'</td>'; // we are looping all data to be printed till last row in the table
echo'</tr>'; // closing table row
}
echo '</table>'; //closing table tag
?>
