I'm trying to create a page that will read the last post of a specific forum and when i run the file i get the following error.
Fatal error: Call to a member function on a non-object in /vservers/lustiesn/htdocs/main.php on line 4
PHP Code:
<?php
error_reporting(E_ALL & ~E_NOTICE);
define('THIS_SCRIPT', 'test');
chdir('/vservers/lustiesn/htdocs/vbulletin');
require_once('./global.php');
$getnews = $DB_site->query_first("SELECT * FROM thread left join post on (post.postid=thread.firstpostid) where thread.forumid=18 order by thread.threadid desc limit 1"); //this is line 5.
$subject = $getnews['title'];
$article = fetch_censored_text(parse_bbcode($getnews[pagetext], $getnews['forumid'], 1));
$date = date('l F d, Y h:i a ',$getnews[dateline]);
echo "<font face=Verdana size=2 color=#A06F1B>";
echo $date;
echo "<br><u>$subject</u></font><br><p><b><font face=Verdana size=2 color=#A06F1B>";
echo $article;
?>
Quote:
Originally Posted by Eddymvp
I'm trying to create a page that will read the last post of a specific forum and when i run the file i get the following error.
Fatal error: Call to a member function on a non-object in /vservers/lustiesn/htdocs/main.php on line 4
PHP Code:
<?php
error_reporting(E_ALL & ~E_NOTICE);
define('THIS_SCRIPT', 'test');
chdir('/vservers/lustiesn/htdocs/vbulletin');
require_once('./global.php');
$getnews = $DB_site->query_first("SELECT * FROM thread left join post on (post.postid=thread.firstpostid) where thread.forumid=18 order by thread.threadid desc limit 1"); //this is line 5.
$subject = $getnews['title'];
$article = fetch_censored_text(parse_bbcode($getnews[pagetext], $getnews['forumid'], 1));
$date = date('l F d, Y h:i a ',$getnews[dateline]);
echo "<font face=Verdana size=2 color=#A06F1B>";
echo $date;
echo "<br><u>$subject</u></font><br><p><b><font face=Verdana size=2 color=#A06F1B>";
echo $article;
?>
|
what i'm missing that is causing the script to fail when it calls the function query_first, do I have to modify another file in order to make this one to work?