I am currently working on a project which helps the students to post their complaints to the administration, everything is working fine but the complaints are not storing in database and while fetching they are not displaying on the webpage.
<?php if(!empty($email)){
include("db.php");
$sno=0;
// $email = $row['email'];
$select = "SELECT * FROM complaints where `email`='$email' order by sno desc";
$q=mysqli_query($con,$select);
while($row=mysqli_fetch_array($q))
{
$sno++;
// $email = $row['email'];
$problem_type=$row['dept'];
$title=$row['title'];
$date=$row['date'];
$description=$row['description'];
$status=$row['status'];
$sid=$row['sno'];
echo "<tr id='tdata'><td>$sno</td><td>$problem_type</td> <td>$title</td><td>$date</td><td>$description</td><td><button type= 'button' 'class='btn btn-primary btn-md' onclick='status_mes($sid)' data-toggle='modal' data-target='#status_mes_Modal' style='width: 80px; height: 30px; border-radius:3px; border: 0.2px solid rgba(88, 5, 243, 0.2); '>$status</button></td></tr>";
}
}
?>
I tried to resolve undefined variable and resolved it using if(!empty($email)) but the data is not displaying on the web page. Would you guys help me out with this problem?