Jump to content

Archived

This topic is now archived and is closed to further replies.

redarrow

delete message via timein database

Recommended Posts

if a user reads a message i wont to delete that message.


order i got it

a user press read message then the database gets updated that the message was read
and a time when that message was read.

so i want to detete that message 5 mins afther the user has press read message

example.

on read.php
[code]
<?

updat the member messages with time and have_read.
$have_read="yes";
$have_read=$_POST($have_read)

$time=date(h:i:s);
$time=$_POST($time);

$query="update member_messages set have_read='$have_read' and time='$read_time' where id='$id'";
$result=mysql_query($query);

$query="select * from member_messages where id='$id'";
$result=mysql_query($query);
$row=mysql_fetch_assoc($result)) {

if ($row['have_read'] >0) {

$time=$row['time_read'];

$delete_message=array("$time");

$m=+5

$query="delete member_message where id=$id";
$result=mysql_fetch($query);
}
}

[/code]


so i need a way to deleta a mess afther 5 min afther the
user has read that message please help cheers.

Share this post


Link to post
Share on other sites
how do i extract the time above code and alter the minites

Share this post


Link to post
Share on other sites
When i land on the message page wont to self post the following cheers.

read_time and have_read cheers.

[code]

$read_time=date("h:i:m");

$have_read="yes";


$query="update member_messages set $have_read and read_time='$read_time' where id='$id'";
$result=mysql_query($query);

[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.