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

Link to comment
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...

 

Brilliant! Thanks alot!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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