In a database I have messages and in the row I have count.
This would go to (1) or (2) depending on how many messages the user has from admin (this part works).
Here is a bit of my code, I would like the count to return to zero when user clicks on the messages.php.
<?php
$user = $_SESSION["username"];
$result = $mysqli->query("SELECT * from messages where email='".$user."'");
if($result) {
while($obj = $result->fetch_object()) {
echo "<li><a href=messages.php>Messages (". $obj->count .")</a></li>";
}
}
?>
This is on localhost and have not added any security on SQL injection yet, I'm just trying to get the code to work first.