I've been staring at this code all day and it's driving me nuts. I'm putting together a forum, and trying to get it to display when the last post in the section was made, and by who.
$username = "username";
$password = "password";
$database = "forum";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die("Unable to select database");
$query = "SELECT * FROM general WHERE last='lastpost'";
$result=mysql_query($query);
$row=mysql_fetch_row($result);
$lastlog = explode(' ',$row[0]);
$lastlogdate = $lastlog[0];
$lastlogtime = $lastlog[1];
$bywho = $row[1];
echo "<font face=Tahoma size=-1 color=\"#dddddd\">Last Post:<br></font><font face=Verdana size=-1 color=\"#ffffff\">",$lastlogdate,", ",$lastlogtime,"<br><br></font><font face=Tahoma size=-1 color=\"#dddddd\">Posted By:<br></font><font face=Verdana size=-1 color=\"#ffffff\">",$bywho,"</font>";
mysql_close();
the first column in the table contains a timestamp made with the NOW() function, the second column is text. the third column simply contains 'lastpost', just so I can find it. I've checked multiple times, and all three columns contain the data they should, but the $lastlog and $bywho variables are all returning an empty string.
I've used this code on another section of the page, to display member information, and it works fine.
Running Apache 2.0.54, PHP 5.0.4, and MySQL 4.1.12
any ideas?