SilentK
06-16-2005, 07:57 PM
I have a query that used to work before I installed 3.5 Now I get this error message whenever I load the page
Fatal error: Call to a member function on a non-object in /./././htdocs/widget.php on line 5
This is the contents of widget.php
<?php
chdir('/./././htdocs/forums');
require 'global.php';
$latestThreads = $DB_site->query("
SELECT *
FROM " . TABLE_PREFIX . "thread AS thread
WHERE thread.visible = 1
ORDER BY dateline DESC
LIMIT 5
");
$num_rows = $DB_site->num_rows($latestThreads);
while($row = $DB_site->fetch_array($latestThreads) )
{
echo('<a href="http://www.xblteams.com/forums/showthread.php?t=' . $row[threadid] . '">' . $row[title] . '</a><br />');
}
?>
That worked before 3.5. What changed? and what do I need to change to make it work?
Also I would like to get it so the links are formatted like this
<a href="javascript:widget.openURL('http://www.xblteams.com/forums/showthread.php?t=put thread id here')"></a>
I've tried
echo('<a href="javascript:widget.openURL('http://www.xblteams.com/forums/showthread.php?t=' . $row[threadid] . ' ')">' . $row[title] . '</a><br />');
but I get a parse error.
Thanks in advance.
Fatal error: Call to a member function on a non-object in /./././htdocs/widget.php on line 5
This is the contents of widget.php
<?php
chdir('/./././htdocs/forums');
require 'global.php';
$latestThreads = $DB_site->query("
SELECT *
FROM " . TABLE_PREFIX . "thread AS thread
WHERE thread.visible = 1
ORDER BY dateline DESC
LIMIT 5
");
$num_rows = $DB_site->num_rows($latestThreads);
while($row = $DB_site->fetch_array($latestThreads) )
{
echo('<a href="http://www.xblteams.com/forums/showthread.php?t=' . $row[threadid] . '">' . $row[title] . '</a><br />');
}
?>
That worked before 3.5. What changed? and what do I need to change to make it work?
Also I would like to get it so the links are formatted like this
<a href="javascript:widget.openURL('http://www.xblteams.com/forums/showthread.php?t=put thread id here')"></a>
I've tried
echo('<a href="javascript:widget.openURL('http://www.xblteams.com/forums/showthread.php?t=' . $row[threadid] . ' ')">' . $row[title] . '</a><br />');
but I get a parse error.
Thanks in advance.