magcr23 Posted June 26, 2015 Share Posted June 26, 2015 Hi guys, as everybody know, in any message system we can delete the message, but i don't want do delete, i want to hide it from the users. An example of what i want: miguel sent a message to admin after admin read it appears for both users the link"delete", but it will only hide the message from the user who pressed the link, the other one will be able to see the message whenever he want. I have this data base: id, from, to, subject, message, date, raiz, read, visible and this code: to show the button: while($ln = mysqli_fetch_assoc($result)){ if($ln['raiz'] == 0 && $ln['visible'] == 1){ echo '<a href="mostraMSG.php?message='.$ln['id'].'"><h2>'.$ln['subject'].'</a><small> para: '. $ln['to'] .'</small></h2>'; if($ln['read'] == 1){ echo '<a href="esconder.php?delete='.$ln['id'].'">apagar</a>'; } } } to hide the message: $update = "UPDATE `messages` SET `visible` = 0 WHERE `id` = '$esconder'"; mysqli_query($con, $update); The problem is if i do this update, it will hide for both of them, How can i make it hide for the one who pressed the link? Quote Link to comment Share on other sites More sharing options...
Solution magcr23 Posted June 26, 2015 Author Solution Share Posted June 26, 2015 solved Quote Link to comment Share on other sites More sharing options...
JuanaCarbajal Posted July 24, 2015 Share Posted July 24, 2015 ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.