wrathican Posted January 24, 2008 Share Posted January 24, 2008 what does this mean, i cant find anything of use on google. my query is: $qallid = "SELECT all_id FROM kb3_alliances WHERE all_name='" . $alliancen . "'"; $rallid = mysql_query($qallid); $all_id = $rallid; echo $all_id; and it just brings up: Resource Id #4 Link to comment https://forums.phpfreaks.com/topic/87545-solved-resource-id-4/ Share on other sites More sharing options...
trq Posted January 24, 2008 Share Posted January 24, 2008 mysql_query returns a resource. Take a look at mysql_fetch_assoc. Link to comment https://forums.phpfreaks.com/topic/87545-solved-resource-id-4/#findComment-447773 Share on other sites More sharing options...
kenrbnsn Posted January 24, 2008 Share Posted January 24, 2008 After doing a mysql_query(), you need to actually fetch the records retreived: <?php $qallid = "SELECT all_id FROM kb3_alliances WHERE all_name='" . $alliancen . "'"; $rallid = mysql_query($qallid); $rw = mysql_fetch_assoc($rallid); $all_id = $rw['all_id']; echo $all_id; ?> Ken Link to comment https://forums.phpfreaks.com/topic/87545-solved-resource-id-4/#findComment-447774 Share on other sites More sharing options...
wrathican Posted January 24, 2008 Author Share Posted January 24, 2008 ahh i see. you see because the query only returned one value i assumed that i wouldnt need that, as it would be pretty straight forward as to what the value was.. thanks alot Link to comment https://forums.phpfreaks.com/topic/87545-solved-resource-id-4/#findComment-447776 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.