Answer the question
In order to leave comments, you need to log in
How to add "read/unread" to messages?
How to record that a person has read a message?
<?php
if(isset($_POST['submit'])){
$ad = $_POST['po'];
$rand = $userdata['users_id'].$ad;
$u = "INSERT INTO `user40727_chat`.`stena` (`ot`,`po`,`tex`,`rand`,`time`) VALUES ('" . $userdata['users_id'] . "','$_POST[po]','$_POST[stena]','".$rand."', '".time('dmYhis')."')";
mysql_query($u) or die(mysql_error($link));
header('Location: mass.php?id='.$ad);
}
?>
Answer the question
In order to leave comments, you need to log in
add a new boolean field to the table and name it prochitano and please read about pdo and php in general
First: NEVER use what you wrote in the example about injecting variables from POST into a SQL query string.
Secondly, as already stated, use a column (preferably TINYINT 0/1) to store the boolean value read/unread (1/0).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question