1zeus1 Posted April 20, 2012 Share Posted April 20, 2012 or need to run this code on the server every 4 to 5 s without opening the page in browser <?php $con = mysql_connect("*","*","*"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("*", $con); $result = mysql_query("SELECT * FROM `ta` WHERE `top` LIKE '0' LIMIT 0,1"); $row_ro = mysql_fetch_array($result); $a = $row_ro['id']; $query="UPDATE tr SET top = '1' WHERE id = '$a'"; mysql_query($query); mysql_close($con); ?> regards Link to comment https://forums.phpfreaks.com/topic/261314-update/ Share on other sites More sharing options...
trq Posted April 20, 2012 Share Posted April 20, 2012 You need to schedule it using cron then, nothing at all to do with PHP. Link to comment https://forums.phpfreaks.com/topic/261314-update/#findComment-1339067 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.