yes, this is valid as google will tell you http://dev.mysql.com/doc/refman/5.0/en/select.html
For your actual error, from the php docs:
For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, mysql_query() returns a resource on success, or FALSE on error.
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message="Invalid query: " . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
// do something
}
Also: you should not use the mysql_* functions anymmore since they are deprecated and unsafe.
Use mysqli_* or PDO instead.
solved can i use where and order by in mysql together?