PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
function lastTopic($forumID)
{
$user="root";
$host="localhost";
$password="++++++";
$database="foums";
$connection=mysql_connect($host,$user,$password) or die ("Couldnt connect to server");
$db=mysql_select_db($database,$connection) or die ("Couldnt select database");
$query="SELECT * FROM threads WHERE forumID='$ForumID' ORDER BY lastPostTime DESC";
$result=mysql_query($query) or die ("Query failed to get the last topic");
$data=mysql_fetch_array($result);
$lasttopic=$data['topic'];
return $lasttopic;
}
the function returns nothing, i guess the sorting is not working....