10-06-2007, 11:24 PM
|
#24 (permalink)
|
|
The Frequenter
Join Date: Sep 2007
Posts: 360
Thanks: 24
|
How would you search query an integer?
PHP Code:
elseif($_POST['areaCode'] != ''){ $szSQL = sprintf("SELECT id FROM schools WHERE areaCode LIKE '%%%d%%' ORDER BY id", $_POST['areaCode']); $iResult = $database->execute($szSQL); while($iRow = mysql_fetch_array($iResult, MYSQL_ASSOC)){ print_r($iRow); } }
It prints the array but with an error.
Array ( [id] => 28 ) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
|
|
|
|