$SQL="SELECT * FROM stats ORDER BY $teamval";
$result=mysql_query($SQL);
$num_results=mysql_num_rows($result);
$teamval is a value defined by a user, which is defined by selecting it in a dropdown list (The selections are all from a database)
What I'm getting is "Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\Program Files (x86)\wamp\www\processlvl1.php on line 44"
Any solutions?
Edit: the variable for $teamval is not a column, it's a variable in a column.
The database tables look something like this:
First Name Last Name Team John Smith ROH Jake Harvey ROH Jerome Micheals ANE
Basically trying to get it to output only the names paired with a certain team that is selected by the user