hiiiiiiiiiiiii alllllll 😉
ive made a func. to create dropdown, the probles is that, im able to retrive all items. , but the corresponding value of the record IS NOT SELECTED, is my Function wrong n needs more arguments! or !!!!.. here z code
calling funtion form emloyees form
<? createdropdown("countries",CountryName,CntryID);?>
function createdropdown($DefTbl,$selectFld,$valueFld)
{
$sql = "Select $selectFld, $valueFld FROM $DefTbl ";
echo "<SELECT NAME=$valueFld size=1>";
$connection=connectMYSQL();//makes a mysql connection
mysqldb();//selects my default database
$record=mysql_query($sql);
while($i = mysql_fetch_array($record))
{
$selectFld=$i[0];
$valueFld=$i[1];
print("<option value=$valueFld SELECTED>$selectFld</option>\n");//doznt slects it!:mad:
}
echo "</SELECT>";
mysql_close($connection);
}