The php script did not retrieve the value from mysql database.
here i have color field in database.i want show that colors in my combo box
please find out my attachment.
if there any errors in following code.
here i have color field in database.i want show that colors in my combo box
please find out my attachment.
if there any errors in following code.
Code:
<?php $con=mysql_connect("localhost","root","red"); if(!$con) { die('Not Connet Our Server'.mysql_error()); } mysql_select_db("my_db",$con); $result=mysql_query("select color from gallery"); echo "<select name='colors'>Shade Color</option>"; while($mycolor=mysql_fetch_array($result)) { echo "<option value=" . $mycolor['id'] .">" . $mycolor['color'] . echo "</option>"; } mysql_close($con); ?>
Comment