I'm trying to echo the elements from a database table with a variable name. This means that I want the table with the same name as my session username. I have the following code that gives out a blank page. Plz help!
<?php
session_start();
if(!isset($_SESSION["sess_user"])){
header("location:./failLogin.php");
}else{
?>
<html>
<?php
$connection = mysql_connect('localhost', 'root', '');
mysql_select_db('fchat');
$result = mysql_query("SELECT * FROM $_SESSION["sess_user"]");
while($row = mysql_fetch_array($result)){
echo "<p><span color="green">" . $row['sender'] . "</span>: " . $row['message'] . "</p><br>";
}
mysql_close();
?>
</html>
<?php }
?>