View Single Post
Old 11-19-2012, 05:24 PM   PM User | #7
willscarlet
New Coder

 
Join Date: Aug 2012
Posts: 65
Thanks: 5
Thanked 0 Times in 0 Posts
willscarlet is an unknown quantity at this point
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:
NoticeUndefined variableresource in C:Inetpubwwwrootmsagindex.php on line 44 Warningsqlsrv_fetch_array() expects parameter 1 to be resourcenull given in C:Inetpubwwwrootmsagindex.php on line 44 
I also get the above error when The page first loads as well.
willscarlet is offline   Reply With Quote