Jump to content

[SOLVED] Few questions


stelthius

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 :/

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.