Author Topic: what is Resource id #4 in mysql  (Read 9869 times)

rahul

  • Newbie
  • *
  • Posts: 16
what is Resource id #4 in mysql
« on: October 09, 2012, 11:56:00 AM »
HI all,
              i make a query in sql like
Code: [Select]
$query  = "SELECT * FROM users
WHERE id = 1";
$res = mysql_query($query);
echo $res;


it shows Resource id #4 if i change id 1 to 100 mean empty result still this shows Resource id #4 can some one make me clear that what this Resource id in mysql and how to check $res is empty or not..

Thanks in Advance

Savera

  • Full Member
  • ***
  • Posts: 159
Re: what is Resource id #4 in mysql
« Reply #1 on: October 10, 2012, 05:00:38 AM »
Resource is something like reference to result you received from mysql after query, so think it as location where result is saved by mysql after you ask for, now you have to go to that resource and get the information which we do using mysql_fetch_assoc() or similar..

rahul

  • Newbie
  • *
  • Posts: 16
Re: what is Resource id #4 in mysql
« Reply #2 on: October 20, 2012, 08:38:40 AM »
thanks for you reply

But there are only two records in my table how could be this possible to find 4 resources and some time i saw Resource  id #22 as well any other idea please help
« Last Edit: October 20, 2012, 08:42:32 AM by rahul »

 

X

Do you know?

By participating in our community you can get free Top Level Domain for lifetime.
Know more..
Join Now!
anything