Page 1 of 1

[SOLVED] Problem with code

Posted: Mon Dec 29, 2003 5:32 am
by dakkonz
Can anyone tell me if there is anything wrong with this statement

$query = "SELECT * FROM song ORDER BY songname ASC WHERE status='$stat'";
$result = @mysql_query ($query);

while ($row = mysql_fetch_array($result)) {
echo "{$row['songname']}";
}//end of while

i get error for $row = mysql_fetch_array($result))
Help!!!!

Posted: Mon Dec 29, 2003 8:38 am
by Weirdan
http://www.mysql.com/doc/en/SELECT.html
You need to place WHERE clause before ORDER BY clause.

Posted: Mon Dec 29, 2003 2:04 pm
by dakkonz
gee thanks