shotazi
03-15-2008, 05:00 PM
So i want to select information from database and after 20 second when file has opened write another information in that row.
i wrote such code:
<?php
$select = mysql_query("SELECT * FROM news WHERE id=5");
$time = time();
$insert mysql_query("INSERT INTO news SET last_time = '$time'");
//
// HERE IS HTML TAGS
//
$time2 = time() + 20;
$last_time = mysql_query("SELECT last_time FROM news WHERE id = 5 ");
if($time2 > $last_time){
$addshows = mysql_query("INSERT INTO news SET shows = 2");
}
?>
but it is not working how i can to work this script? or is another way to make such script?
i wrote such code:
<?php
$select = mysql_query("SELECT * FROM news WHERE id=5");
$time = time();
$insert mysql_query("INSERT INTO news SET last_time = '$time'");
//
// HERE IS HTML TAGS
//
$time2 = time() + 20;
$last_time = mysql_query("SELECT last_time FROM news WHERE id = 5 ");
if($time2 > $last_time){
$addshows = mysql_query("INSERT INTO news SET shows = 2");
}
?>
but it is not working how i can to work this script? or is another way to make such script?