I'm getting a weird result when i try to implement the PHP inside a HTML
The config is literally my DB connection, other scripts work well but only for this matter i couldn't figure out.
Maybe I missed out some elements.
<select name="country">
<option value="" disabled selected style="display: none;">All Japan Cities</option>
<?php
include 'scripts/config.php';
$query = "SELECT state FROM product";
$result = mysql_query($query);
$count = count($result);
if (!empty($count)) {
while($row = mysql_fetch_array($result))
{
$state = $row['state'];
echo "<option value='$state'> $state </option>";
}
} else {
echo '<option>No data</option>';
}
?>
</select>
I keep on getting no data for my select statement where I have 3 results in my db.
mysqlextension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used