I am trying to get a row from my table where id is max to pint it on first blog page; and I get the error in the title ..
this is my index.php code for calling it , i am not sure if it is the right way to use ur website codes :
[CODE]$blog= new Blog();
$blog->getArticleList();
$rescentArticle= $blog->rescentArticle();
print "Article Title : ".$rescentArticle->title."Article body :".$rescentArticle->body;
[/code]
[CODE]
function rescentArticle()
{
//select on the article table and save the articles in the articleList
$result= mysql_query("select * from article where ID=(select max(ID) from article)");
print_r ($result);
if (!$result) die('Invalid query: ' . mysql_error());
while ($row= mysql_fetch_assoc($result))
{
$article= new Article($row['ID'],$row['date'],$row['title'],$row['body']);
array_push($this->articleList,$article);
//$article->getCommentList();
}
}
function getMaxID()
{
return $MaxID= mysql_query("select max(ID) from article");
}
[/code]