there is an email address in the user session, and I am trying to use the extracted info to access the other relevant info on the user from the database. Here is what I have.
$author = explode(":", $_SESSION['user_id']);
$query = mysql_query("SELECT * FROM users WHERE `active`='1' AND `email`=$author[1]");
while ($query_row = mysql_fetch_assoc($query)) {
// does stuff in here.
}
for some reason I get back "mysql_fetch_assoc() expects parameter 1 to be resource, boolean given." If I echo out "$author['1']" I get the correct email address for the logged in user. How do I go about writing the query correctly?