mysql_query -- question about results "location"

Posted by Andrew Heath on Stack Overflow See other posts from Stack Overflow or by Andrew Heath
Published on 2010-05-19T03:41:28Z Indexed on 2010/05/19 3:50 UTC
Read the original article Hit count: 251

Filed under:
|

Forgive me if this is a particularly stupid question!

mysql_query($query)

returns a boolean, but you can also assign it to a variable

$results = mysql_query($query)

and then use the other mysql_ functions to extract data.

Out of curiosity, how does mysq_query($query) act as both a boolean and a data container at the same time? What's happening "under the hood" during these steps?

(yes, I am a n00b..., please be kind!)

© Stack Overflow or respective owner

Related posts about mysql

Related posts about php