Jump to content

Recommended Posts

Ok, ive changed my Query as instructed posted a nwe alert to make sure it works but the time stamp is displaying as 0000-00-00 00:00:00 is that because of something im doing wrong ?

i did add the field correctly timestamp TIMESTAMP thats all i added so im pretty sure its not something im doing

 

 

 

EDIT ~

 

its displaying like this - 0000-00-00 00:00:00 in the database*

change index

 

<?php
if($session->logged_in){
   echo "<font face='Verdana' color='#FFFFFF' size='2'> Welcome back <b>$session->username</b>,
}
$username="root";
$password="******";
$database="login";

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$query = "SELECT message, timestamp FROM admin_message ORDER BY id DESC LIMIT 1";
$result = mysql_query($query);
$detail = mysql_fetch_array($result);
$tenMinsAgo = time() - (60*10);
if($details['timestamp'] > $tenMinsAgo)
{
      echo '<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#FF0000"><tr><td><strong>Message from the administration:</strong>'.$detail['message'].'</td></tr></table><br>';
}
?>

Hmmm, thats actually just displaying a blank page now, im not to sure why

 

But its something to do with this piece of code here

 

 

$tenMinsAgo = time() - (60*10);
if($details['timestamp'] > $tenMinsAgo)

 

as i removed that to see if it was that causing the problem and it was :/

yes the error it outputs is

 

Notice: Undefined variable: details in /var/www/html/broadcast.php on line 18

 

 

line 18 is

 

 

 

if($details['timestamp'] > $tenMinsAgo)

 

i thought it was somethign to do with those two lines but i wasnt sure

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.