Jump to content

Recommended Posts

I don't know how much php is involved. This may belong in the SQL area.

Anyway, this frusterates me. Its not unusual for me to encounter resource id issues and hours of searching has yielded very little result. Maybe I have a wrong approach or something, I would like to learn.

So this query:

[code]$query = "SELECT frc_id FROM frc_users WHERE frc_id = '$userid' ";
$result = mysql_query ($query) or die(mysql_error());
echo $query;    
echo $result;[/code]

I get the right query:

[code]SELECT frc_id FROM frc_users WHERE frc_id='2'[/code]

But the result is the resource id #18. What gives?
Link to comment
https://forums.phpfreaks.com/topic/12952-resource-id-18/
Share on other sites

You cant echo $result in its raw state. You have to use a function like mysql_fetch_array in order to get the results. $result justs stores the result resource which is loaded into memory.

So if you do this:
[code]$rows = mysql_fetch_array($result);

echo print_r($rows);[/code]

You'll now see your results.
Link to comment
https://forums.phpfreaks.com/topic/12952-resource-id-18/#findComment-49788
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.