unknown column in where clause

Posted by ranzy on Stack Overflow See other posts from Stack Overflow or by ranzy
Published on 2010-04-14T07:00:19Z Indexed on 2010/04/14 7:03 UTC
Read the original article Hit count: 225

Filed under:
|
|
$result = mysql_query("SELECT * FROM Volunteers WHERE Volunteers.eventID = " . $var);

$sql = mysql_query("SELECT * FROM Members WHERE Members.pid = " . $temp);

I am also doing or die(mysql_error()) at the end of both statements if that matter. My problem is that the first statement executes perfectly but in that table I store an attribute called pid. So the second statement is supposed to take that and return the row where it equals that pid so I can get the name. I get an error that says unknown column in 'a2' in 'where clause' where a2 the pid attribute returned from the first statement. Thanks for any help!

© Stack Overflow or respective owner

Related posts about mysql

Related posts about select