Sir I have these codes

<?php
session_start();
require_once("includes/connectw.php");

$query = "SELECT distinct(MONTH(date)) AS 'month'  FROM arrival order by date" ;
echo $query;
$result = mysqli_query($con,$query)or die ("Error". mysqli_error($con)) ;  

if(mysqli_num_rows($result)>0){
echo "<select name='per1' id='per1'>";
echo "<option selected='selected'></option>";

    foreach($month as $name) { 
      echo "<option value='".$name."'></option>";
    } 
echo "</select>";
}
?>

$result has values but option list does not get values, I think this line is not correct

[PHP] echo "<option value='".$name."'></option>";[/PHP]

Please help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.