I am trying to display last visit of a user in my page. The commands seems ok, but it doesn't work. I have tried everything.
DATABASE SELECTION-OK
TABLE SELECTION-OK
if($result)- EXECUTES
but the UPDATE and the details I can not fetch from database. Here's the code:
$conn = mysqli_connect("localhost","root","","counter");
$qry = "SELECT * FROM nodupes WHERE ids_hash = 'ids_hash'";
$result = mysqli_query($conn,$qry);
if($result)
{
$data = mysqli_fetch_assoc($result);
$lastvisit = $data["lastvisit"];
$timex = time() - $lastvisit;
}
$curr_time = time();
$qry2 = "update nodupes set lastvisit='$curr_time' WHERE ids_hash='ids_hash'";
$result2 = mysqli_query($conn,$qry2);
What should I do? The lastvisit in the database always shows 0