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
Are php sessions cookies?
Does php support multithreading?
Does php class need constructor?
What is a php 5?
How do I debug php?
What is the purpose of $_ session?
Tell me what's the difference between include and require?
Explain scalar type declarations in php7?
What is the difference between Session and Cookie?
How is a constant defined in a PHP script?
Does php support polymorphism?
How do I clear my browser session?
What is cookie and why do we use it?
What are the functions to be used to get the image's properties (size, width and height)?
What is the difference between $_files['userfile']['name'] and $_files['userfile']['tmp_name']?