okay, when I added your code, I got this print out when I hit submit:
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 'ORDER'. [message] => [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near the keyword 'ORDER'. ) )
So I added '' around the Criteria variable:
PHP Code:
$query = "SELECT * FROM MSAG WHERE $category LIKE %$criteria% ORDER BY StreetName ASC";
after that, if I just hit sumbit on the page, it will output ever record in the database, however, if I try and fill in the search critera I get this error:
PHP Code:
Notice: Undefined variable: resource in C:Inetpubwwwrootmsagindex.php on line 44 Warning: sqlsrv_fetch_array() expects parameter 1 to be resource, null given in C:Inetpubwwwrootmsagindex.php on line 44
I also get the above error when The page first loads as well.