I have a mySQL database, and I have the option that it displays all the 'Treatments' as a dropdown box on my html page. How would I go about implementing the code, so that if the user wants to select more than one treatment, another dropdown box will appear?
EDIT: e.g. Lets say you are shopping for some items online, and you have all the items listen in a dropdown box. You pick one, and then you want to pick more. So you click: 'add more' and another dropdown appears on the page where you can select another item.
Here is the PHP code:
<?php
$hostname = 'hostname';
$dbname = 'dbname';
$username = 'username';
$password = 'password';
$con=mysql_connect($hostname,$username,$password,$dbname) or die("Failed to connect to MySQL: " . mysql_error());
$db=mysql_select_db($dbname,$con) or die("Failed to connect to MySQL: " . mysql_error());
$query = "SELECT * FROM `Treatments`";
$result = mysql_query($query, $con);
$options = "";
if (!$result){
die("No results found.");
}
while ($row = mysql_fetch_array($result)){
$options .= "<option>$row[1]</option>";
}
?>