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
Explain about getters and setters in php?
What does csrf token mean?
How to insert an new array element in array?
How to count all the lines of code in a directory and sub folder?
Is php secure?
What is exception handling in php?
What is the use of array_count_values() in php?
How can we submit a form without using submit buttons?
How to pad an array with the same value multiple times?
What is encapsulation in php?
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what is the problem?
What is $_ post in php?
What are advantages of .htaccess?
Which is better session or cookie?
What is escape data in php?