View Single Post
Old 10-06-2007, 11:24 PM   #24 (permalink)
Haris
The Frequenter
Prolific Welcomer Upcoming Programmer 
 
Join Date: Sep 2007
Posts: 360
Thanks: 24
Haris is on a distinguished road
Default

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($iResultMYSQL_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
Haris is offline  
Reply With Quote