jbpeake
asked on
SQL query error: Operand should contain 1 column(s)
When I run the sql query below I get an error that says "Operand should contain 1 column(s)" It is probably something simple I'm new to trying to write two statements together. Any thoughts?
$data = mysql_query("SELECT username, first_name, last_name, middle_name FROM users WHERE username IN (SELECT * FROM users WHERE state_id=".$session_state_id.") ORDER BY ".$sorter." ASC")
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
of course, gamebits's query code is more efficient, anyhow :)
ASKER
Ughh... painfully obvious when I see what you done. Thanks.
" painfully obvious " believe me I know the feeling, thanks for the points and the grade.
is wrong, as SELECT * returns multiple columns.
this would work better:
Open in new window