How to pass php array value to jquery select box.
i tried like
$sql_customer = mysql_query("select * from tbl order by customer_name");
while($row_customer = mysql_fetch_array($sql_customer)){
$customer_arr[$row_customer['id']] = $row_customer['customer_name'];
}
And pass into jquery as json encoded value
var customerarray = ;
var seloption = '';
$.each(customerarray, function (i, elem) {
seloption += '<option value="'+customerarray[i]+'">'+customerarray[i]+'</option>';
});
How can i get table id in option value, now its getting customer name