Quote:
Originally Posted by ChurchMedia
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:
Here is my plug-in code at postbit_display_start:
PHP Code:
$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! 
|
Since it is inside a class use:
PHP Code:
$this->registry->db->query_read()
Instead of $db->query_read()
Also, that code looks like it runs a query for every post, which I don't suggest doing.