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 Quote 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. Quote 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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/87545-solved-resource-id-4/#findComment-447776 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.