Hi ,
I created code for showing name using dropdown box inthat dropdown box all names are stored directly from the database.here i send the code also but its not working can anyone tell why its not working
Thanks
Punithapary
Code:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “
<html xmlns=”
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
</head>
<body>
<form>
<table align=”center”>
<tr>
<td>Select any name</td>
<td>
<select name=”select” style=”width: 150px”>
<?php
$catagory_sql = “SELECT * FROM `register`fname
$enr=mysql_query($catagory_sql);
echo $cnr = mysql_num_rows($enr);
if($cnr > 0)
{
while($ca1 =mysql_fetch_array($enr))
{
echo ‘<option value=”‘ . $ca1[id] . ‘”>’ . ucwords(“$ca1[fname]”) . ‘</option>’;
$catagory_psql=”SELECT * FROM `register` WHERE `id` = $ca1[id] ORDER BY `fname` ASC”;
$enrp = mysql_query($catagory_psql);
$cnrp = mysql_num_rows($enrp);
if($cnrp > 0)
{
while($ca1p =mysql_fetch_array($enrp))
{
echo ‘<option value=”‘ . $ca1p[id] . ‘”>—‘ . ucwords(“$ca1p[fname]”) . ‘</option>’;
}
}
}
}
?> </select> </td>
<input type=”submit” name=”submit” value=”submit” />
</tr>
</table>
</form>
</body>
</html>