I am using PHP and when I tried to use the following query on SQL Server, it gives me a syntax error saying there is an invalid use near the key word WHERE. If I don't use the WHERE Status='Open' part in my query, this works fine without any error. Does the SQL server considering Status or Open as keywords?
$query = "SELECT * FROM ElectronicShop ORDER BY Completed WHERE Status='Open'";
Error:
Array ( [0] => Array ( [0] => 42000 [SQLSTATE] => 42000 [1] => 156 [code] => 156 [2] => [Microsoft][SQL Server Native Client 10.0][SQL Server]
Incorrect syntax near the keyword 'WHERE'. [message] => [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near the keyword 'WHERE'. ) )