Last year i did alot with php for this project but it seems i forgot almopst everything. What i want to do is make a form. within this form i want to have a dropdown menu where the options are al the organization names in the database. I think i have to use a while loop and somehow compare an incrementing variable to the primary key within the database. I have no idea how i would code this. the only thing i could think of was:
Code:
$x=0;
while(SELECT orgname FROM organization WHERE orgId = $x){
echo "<option value=\"$orgName\">$orgName</option>";
$x++;
}
I know this cant be right. for one thing orgName doesnt come out of the databse as a variable. Also i'm not sure i can use a SELECT FROM WHERE within a while loop.
Can anyone help me out ?
Last edited by The_Anomaly; 11-28-2005 at 03:27 PM..
|