Let me simplify this even more.
If I have 1 table.
tblSubjects
ID Name Image Gender
------------------------------------
1 name1 image1.jpg male
2 name2 image2.jpg female
3 name3 image3.jpg male
4 name4 image4.jpg male
5 name5 image5.jpg female
Now I need an insert form for a second table where I match up two of the subjects, (1 male & 1 Female), making a pair.
I want two dynamic drop downs that are populated from this table. But rather than having all subject's name included in both table, I want just the males in one drop down menu and just the females in the other.
So far, I have created two record sets based on this one table. Here is what I have.
mysql_select_db($database_dbCMS, $dbCMS);
$query_rsMales = "SELECT * FROM tblBreedersp WHERE sex = 'Male'";
$rsMales = mysql_query($query_rsMales, $dbCMS) or die(mysql_error());
$row_rsMales = mysql_fetch_assoc($rsMales);
$totalRows_rsMales = mysql_num_rows($rsMales);
mysql_select_db($database_dbCMS, $dbCMS);
$query_rsFemales = "SELECT * FROM tblBreedersp WHERE sex = 'Female'";
$rsFemales = mysql_query($query_rsFemales, $dbCMS) or die(mysql_error());
$row_rsFemales = mysql_fetch_assoc($rsFemales);
$totalRows_rsFemales = mysql_num_rows($rsFemales);
This works fine but I can't seem to populate the related hidden fields when their names are selected. I found a really cool Javascript that works, but there seems to be some conflicts between it and what WA wants on the page. It uses an array object. But I would like to do this with straight php if I can.
How do I create two arrays that loop through and give one menu the females and one menu the males? And include the other information as it inserts them into the new table?
Thanks,
TroyD