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 difference between core php and framework?
Can I run php without xampp?
What are the differences between mysqli_connect and mysqli_pconnect?
What is a php certification?
How to create a session? How to remove data from a session?
How do I run a php script in windows?
Is php good for career?
Which programming language does php resemble to?
What is the use of 'print' in php?
What is the difference between md5(), crc32() and sha1() crypto on php?
What is alias in php?
How many keywords are there in php?
What is php and why it is used?
What is meant by pdo in php?
In PHP, fgets() is used to read a file one line at a time. State Whether True or False?