Topic: $db->query() returns error (custom code)
I'm using FluxBB's $db->object (v1.2.20) in my site's code to make it cleaner and somewhat easier to read.
$console['url'] = safeUrl($_GET['cname']);
$result = $db->query('SELECT cid, cname FROM consoles WHERE cname_url='.$console['url'].' LIMIT 1') or error('Unable to fetch console info', __FILE__, __LINE__, $db->error());
list($console['id'], $console['name']) = $db->fetch_row($result);everytime it spits out the error with no more information attached to it. no mysql_error, nothing. pun's config is called by index.php which uses switch to include my pages. i can use: in the same script and it works fine. the fields cid, cname and cname_url all exist and $console['url'] has a valid value. is there something in pun's config that doesn't allow it to query any table other than it's own?
$result = $db->query('SELECT id, username, realname FROM '.$db->prefix.'users WHERE group_id='.PUN_ADMIN.' ORDER BY username', true) or error('Unable to fetch staff list', __FILE__, __LINE__, $db->error());
while ($staff = $db->fetch_assoc($result))
echo $staff['id'];what would i have to do to make it work right?
thanks in advance
-xP
P.S. I don't know whether or not it should go here or in 1.2's support forum, so I chose here because although it deals w/ flux's code, it's not directly related to flux's scripts other than it's functions (which in general work fine)
Last edited by xPlozion (2008-08-07 21:54:23)
OS: Arch Linux x86_64 (2008.06) / Windows XP