PDA

View Full Version : Resource id #66


pyro.699
08-06-2006, 12:54 PM
ok, i have this error Resource id #66 and i get it from this line of code

$equip = $db->query_read("SELECT * FROM `abp_equip` WHERE `userid`='$userid' AND `typeid`='$typeid' LIMIT 1");


this script is located in


$userid = $vbulletin->userinfo['userid'];
$equip = $db->query_read("SELECT * FROM `abp_equip` WHERE `userid`='$userid' AND `typeid`='$typeid' LIMIT 1");
if($db->num_rows($equip) == 1 and $item['type'] != 7)
{
$query = $db->query_first("SELECT * FROM `abp_equip` WHERE `userid`='$userid' AND `typeid`='$typeid'");
$item = $db->query_first("SELECT * FROM `abp_items` WHERE `id`='".$query['itemid']."'");
if($typeid == '1' or $typeid == '6' or $typeid == '9')
{$width = 85; $height = 85;}
if($typeid == '2' or $typeid == '7')
{$width = 30; $height = 30;}
if($typeid == '3' or $typeid == '4' or $typeid == '5')
{$width = 100; $height = 150;}
if($typeid == '8')
{$width = 100; $height = 30;}
$stats[strtolower($typename)] = stats($item['id'], $total, false, $typeid, $item['image'], $item['description'], false, $userid, $item['name'], false, true, $width, $height);
$total++;
}


Thanks
~Cody Woolaver

Guest190829
08-06-2006, 01:07 PM
What is the complete error you are getting?

$equip is a resource variable...

pyro.699
08-06-2006, 02:15 PM
That is the complete error...
https://vborg.vbsupport.ru/

This is where its displaying

I know its that line, because i '//' it out, and then it works.

Guest190829
08-06-2006, 02:45 PM
That is the complete error...
http://pyro.allblizz.com/Resource66.gif

This is where its displaying

I know its that line, because i '//' it out, and then it works.


Are you echoing $equip anywhere? Because that is what it will display. That isn't an error above, if you display a resource variable it will look like that.

Code Monkey
08-06-2006, 04:45 PM
You must be echoing it somewhere. You're also doing the same query twice and adding a another query that is not needed. Try this, untested.


$userid = $vbulletin->userinfo['userid'];
if($query = $db->query_first("SELECT equip.*, items.* FROM abp_equips AS equip LEFT JOIN abp_itmes AS items ON items.id = equip.itemid WHERE equip.userid='$userid' AND equip.typeid='$typeid'"))
{
switch($typeid)
{
case 1:
case 6:
case 9:
$height = $width = 85;
break;
case 2:
case 7:
$height = $width = 30;
break;
case 3:
case 4:
case 5:
$width = 100;
$height = 150;
break;
case 8:
$width = 100;
$height = 30;
break;
}
$stats[strtolower($typename)] = stats($query['id'], $total, false, $typeid, $query['image'], $query['description'], false, $userid, $query['name'], false, true, $width, $height);
$total++;
}