php - how to get data from database mysql in form select html? -
i trying show data database tag> select html. here code :
<?php require 'koneksi.php'; $sql_select = "select nama_supplier supplier"; $hasil = mysql_query($sql_select); if(!$hasil) { echo "data not found ".mysql_error(); } mysql_close(); ?> <div class="par control-group"> <label class="control-label" for="supplier">supplier</label> <select name="supplier" class="uniformselect"> <?php while($baris = mysql_fetch_array($hasil)){ echo "<option value='$baris'>".$baris."</option>"; } ?> </select> </div> the problem is, output doesn't show option value database. output print 'array'. here screenshot : image . know has simple missing cannot figure out. please help, thanks!
you need select row $baris variable stands array
echo $baris['coulmn want']; if don't variable $baris equal that. need select column want.
([id]->1,[name]->'user',...,['email']->a@a.com)
Comments
Post a Comment