ChurchMedia
12-26-2006, 04:21 PM
I'm writing a hack and I can't figure out how to query a table and then use the data in a plug-in. I get this error:
Fatal error: Call to a member function on a non-object in /home/xxx/xxxx/forum/includes/class_postbit.php(268) : eval()'d code
Here is my plug-in code at postbit_display_start:
$info = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "secretsanta");
$usinfo = $db->fetch_array($info);
$uid = $usinfo['userid'];
$gave = $usinfo['gave'];
$received = $usinfo['received'];
if (!$this->post['uid'] = '') {
$santa = "<div align=\"center\"> <a href=\"giftexchange.php\"><img src=\"images/giftexchange/sm_secret_santa.gif\" border=\"0\" alt=\"$post[username] is a Secret Santa!\"></a></div>";
}
Any help is appreciated! :)
Fatal error: Call to a member function on a non-object in /home/xxx/xxxx/forum/includes/class_postbit.php(268) : eval()'d code
Here is my plug-in code at postbit_display_start:
$info = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "secretsanta");
$usinfo = $db->fetch_array($info);
$uid = $usinfo['userid'];
$gave = $usinfo['gave'];
$received = $usinfo['received'];
if (!$this->post['uid'] = '') {
$santa = "<div align=\"center\"> <a href=\"giftexchange.php\"><img src=\"images/giftexchange/sm_secret_santa.gif\" border=\"0\" alt=\"$post[username] is a Secret Santa!\"></a></div>";
}
Any help is appreciated! :)