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
How many open modes available when a file open in PHP?
What are include() and require() functions?
What is escaping to php?
Does PHP 5 support exceptions? State Whether True or False?
What is magic function in php?
Is python easier than php?
hello all, I need some sample placement papers in lion bridge.. can anyone help me?
What should we do to be able to export data into an excel file?
Explain difference between urlencode and urldecode?
In php, how to redirect from one page to another page?
What is the use of mysql_real_escape_string() function?
Can you give example for trait in php?
How to get ip address of a server in php?
How to concatenate two strings in php?
How can you create a session in php?