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

Popular posts from this blog

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -