Make a "dynamic drop down list" with using only PHP,HTML
and MySQL..
Answer Posted / sasmitamohanta
<select name="name">
<option value="">Select Name</option>
<?
// make connection to data base
mysql_connect('localhost','root','') ;
//select database
mysql_select_db('mail');
//select all da from 'table' say it ve two colom Id and Name
$sql=mysql_query("select * from table");
//select one by one row data s
while($r=mysql_assoc($sql))
{?>
<option value="<?=$r['Id'];?>"><?=$r['Name'];?></option>
<?}?>
Is This Answer Correct ? | 5 Yes | 5 No |
Post New Answer View All Answers
What is design pattern? Explain all including singleton pattern?
How do I sort numbers in php?
What is composer phar?
Tell me what is pear?
Write syntax to open a file in php?
How to track user logged out or not? When user is idle?
What is the advantage of runtime polymorphism?
Difference between get and post method.
What is return in php function?
What is the purpose of the '.myd' file extension? What do thes file contain?
Which is better python or php?
Will php die?
What is faster in php?
What is difference between php and wordpress?
What is data abstraction in php?