I'm trying to display username (cocname), but nothing happened. Do you see why? there is no error but the username is missing also and "Hello" is not displayed.Thank you.
<?php
session_start();
include_once 'config.php';
$prepend = "<span class='cocname'>";
$append = "</span>";
if (!isset($_SESSION['email'])) {
header("Location: signin.php");
}
$query = "SELECT cocname FROM users WHERE email=".$_SESSION['email'];
$result = $connect->query($query);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc())
{
echo $prepend."Hello ".$row['cocname'].$append;
}
}
?>