Okay, this is the output I get now (I had to add a LIMIT to the querry though, as it output all 4265 records if not):
PHP Code:
$query = "SELECT * FROM MSAG WHERE $category LIKE '%$criteria%' ORDER BY StreetName ASC LIMIT 1";
PHP Code:
Array ( [0] => Array ( [0] => 42000 [SQLSTATE] => 42000 [1] => 102 [code] => 102 [2] => [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near 'LIMIT'. [message] => [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near 'LIMIT'. ) )