Ok here is what I have:
1 Database, 3 Tables: Race, Class, RaceClass.
Race and Class have 15 entries each and 2 fields:
Race.............. id ************ Class...............id
_______________ ************ _________________
Barbarian ----- 1 ************ Bard ----------- 1
Dark Elf ------ 2 ************ Beastlord ------ 2
Dwarf -------- 3 ************ Cleric ---------- 3
Etc...
TABLES ARE:
PHP Code:
mysql_select_db($database_Iron, $Iron);
$query_race = "SELECT * FROM racelist";
$race = mysql_query($query_race, $Iron) or die(mysql_error());
$row_race = mysql_fetch_assoc($race);
$totalRows_race = mysql_num_rows($race);
mysql_select_db($database_Iron, $Iron);
$query_class = "SELECT * FROM classlist";
$class = mysql_query($query_class, $Iron) or die(mysql_error());
$row_class = mysql_fetch_assoc($class);
$totalRows_class = mysql_num_rows($class);
The third table is my JOINING table and has 2 fields and is something like:
Race ***** Class
_____**** ____
1 ----------- 1
1 ----------- 3
2 ----------- 1
2 ----------- 2
3 ----------- 1
3 ----------- 3
A Barbarian can be a Bard or a Cleric BUT NOT a Beastlord
A Dark Elf can be a Bard or a Beastlord BUT NOT a Cleric
A Dwarf can be a Bard or Cleric BUT NOT a Beastlord
PHP Code:
SELECT classlist.class FROM ((racelist INNER JOIN RaceClass ON racelist.id = RaceClass.race) ) INNER JOIN classlist ON RaceClass.class = classlist.id
Now to the problems/questions
I am VERY NEW at web page programming and have really no idea where to start. I am trying to do what this other guy has been asking about.
I need to have the user Select the RACE,
PHP Code:
<form action="" method="get">
<form name="My Form">
<select name="Race" >
<option value="">Select Race</option>
<?php
do {
?>
<option value="<?php echo $row_race['id']?>"><?php echo $row_race['race']?></option>
<?php
} while ($row_race = mysql_fetch_assoc($race));
$rows = mysql_num_rows($race);
if($rows > 0) {
mysql_data_seek($race, 0);
$row_race = mysql_fetch_assoc($race);
}
?>
</select>
and based on the 'race' I need the appropriate CLASSES to fill my second list, as you can see it is a MANY TO MANY connection as any selected race may be 1 to 15 of a certain class and vis a vis any certain class might be a particular race
This don't work correctly
PHP Code:
<select name="Class">
<option value="" <?php if (!(strcmp("", $row_race['id']))) {echo "SELECTED";} ?>>Select
Class</option>
<?php
do {
?>
<option value="<?php echo $row_class['class']?>"<?php if (!(strcmp($row_class['id'], $row_race['id']))) {echo "SELECTED";} ?>><?php echo $row_class['class']?></option>
<?php
} while ($row_class = mysql_fetch_assoc($class));
$rows = mysql_num_rows($class);
if($rows > 0) {
mysql_data_seek($class, 0);
$row_class = mysql_fetch_assoc($class);
}
?>
</select>
</form>
</form>
after the class is selected I need to take both values(variables) and assign them to a USER table Variable so I can write them and all the other USER information to the user table.
I can get the first list to fill in just fine but I can't seem to figure out what I need to pass to the second list to get the correct values to show and have NO IDEA in the world how to work with Variables in a web document. I am not against being pointed in the right direction on where to read how to work with variables if you think it is below you to explain but please help with this, I have been trying to figure it out for about a week andf I am LOSING sleep and GOING CRAZY!! 
P.S.
Sorry about all the dashes and astrics(sp?) but I could not get this to format without them.
P.S.S
I am using DW-MX[PHP]
Bookmarks