Jump to content

[SOLVED] if/else to meet a condition


graham23s

Recommended Posts

Hi Guys,

 

i'm not sure how to go about the if/else code i'm trying to write, basically when a profile is made i get the "Join Date" (which is basically a timestamp) then add 1 hour to it like:

 

$time = date('Y-m-d H:i:s', strtotime("$added +1 hour"));

 

what i was wanting to happen is , when the new timestamp is met ($time) which is 1 hour ahead some text saying "new profle" disappears (so basically new profile only stays there untill the 1 hour is up) then disappears

 

would an if else statement do this at all?

 

thanks guys

 

Graham

Link to comment
Share on other sites

its more than an if else statement, you are talking a sorta cron job or something of that nature, its more of (if you using mysql)

select `UserID` From Users Where CreationDate >= $time

that will get you all users made in last hour then say

<?php
$query = "select `UserID` From Users Where CreationDate >= $time";
$result = mysql_query($query) or die(Mysql_error());
while($row = mysql_fetch_assoc($result){
{
$tempQ = "Update Users Set New=0 Where UserID = $row['UserID']";
mysql_query($tempQ);
}
?>

to give you a rough idea

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.