Digital World Freelancer

The Digital World Freelancer group is applying latest Technologies Like HTML, CSS, CSS3, JavaScript, JQuery, PHP and more...... for website designing & developing... reach at our organization http://www.digitalworldfreelancer.com

Facebook Page

Monday, October 13, 2014

How to Select name from Table in Select Box(dropdown) Through MySQL and PHP !


If you are facing problem in select name from table of  MySQL(in drop down select box only for one select box if you are more after this select box you will have to use ajax)

so...

1 Step)
Create database and table.......

2 Step) 


<div class="setting">
<div class="input text">
<label for="setting0value">select art student</label>
<select name="art" value="">
<option> --select-- </option>
<?php
$sql=mysql_query("select *from students where streem='art'");
while($row = mysql_fetch_array($sql))
{
?>
<option value="<?php echo $row['id'];?>">
<?php echo $row['name'];?>
</option>
<?php
}
?>
</select>
</div>

</div>

No comments: