Jump to content

Show content in the future?


KvickaN

Recommended Posts

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

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...

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!

Archived

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

×
×
  • Create New...

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.