I have this error when i open the page...but once i select the city from dropdown list,the error doesn't exist. Error is like this:
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1]
SELECT * FROM wp_city_details WHERE id=
I have city dropdown list like this:
<select class="form-control" name="city" id="city" onchange="this.form.submit();">
<option value="0 ----"></option>
<?php
$i = 1;
$cities = all_cities();
foreach ($cities as $city){
$value = $i . " " . $city;
?>
<option
<?php
if (isset($_POST["city"])){
if ($_POST["city"] == $value){
?> selected="true" <?php
};
}
?>
value="<?php echo $value; ?>"><?php echo $city;?></option>
<?php
$i++;
}
?>
</select>