KvickaN Posted January 15, 2011 Share Posted January 15, 2011 Hello! I've managed to solve that the content is shown AFTER 6 hours when added to the SQL. But I want to add many things on the same (current time) but I don't want everything to pop up after 6 hours. I want a 6 hour delay on EACH content I add. How do I solve this? Here is my code: $six_hours_ago = time() - 21600; $sql = "SELECT * FROM Trailers WHERE Genre LIKE '%".$_GET['show']."%' AND time < '".$six_hours_ago."' ORDER BY `Trailers`.`sort` DESC"; insert.php $sql="INSERT INTO Trailers (Poster, Title, Year, Genre, IMDB, Actors, Plot, Youtube, time) VALUES ('".mysql_real_escape_string($_POST['Poster'])."','".mysql_real_escape_string($_POST['Title'])."','".$_POST['Year']."','".mysql_real_escape_string($_POST['Genre'])."','".$_POST['IMDB']."','".mysql_real_escape_string($_POST['Actors'])."','".mysql_real_escape_string($_POST['Plot'])."','".$_POST['Youtube']."', '".time()."')"; Thanks! Link to comment https://forums.phpfreaks.com/topic/224473-show-content-in-the-future/ Share on other sites More sharing options...
requinix Posted January 15, 2011 Share Posted January 15, 2011 Add a field to your form for how long (minutes, hours, days, whatever) to wait until it's available. Then change the table to have two time fields: one for when the thing was actually created, and one for when it should "pop up". Change your INSERTs and SELECTs appropriately... Link to comment https://forums.phpfreaks.com/topic/224473-show-content-in-the-future/#findComment-1159582 Share on other sites More sharing options...
KvickaN Posted January 15, 2011 Author Share Posted January 15, 2011 Add a field to your form for how long (minutes, hours, days, whatever) to wait until it's available. Then change the table to have two time fields: one for when the thing was actually created, and one for when it should "pop up". Change your INSERTs and SELECTs appropriately... Brilliant! Thanks alot! Link to comment https://forums.phpfreaks.com/topic/224473-show-content-in-the-future/#findComment-1159583 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.