Hi there me again, sry for the many questions but only way to learn for me is to try (even if I cant succeed)
Please feel free to ask any questions of me if I'm not being clear :)
What i'm trying to do is basically a auto-select or I guess it might be considered a chain select.
The player would select their UPPER armor from the form and the other dropmenus would change to the same series automatically. I'm not sure if this would be easier accomplished in another manner but I was kinda looking at something like This.
Only tough part is the menus are all populated by a database query.
Here is the part of the form that would be effected by this.
<form method="post" action="player_h_insert_2.php">
<table>
<tr>
<th>Upper Body </th>
<td><select size="1" name="Mainuppertype">
<option value="" selected>Select Your Main Class Upper Armor</option>
<?php
include('../../lib/connections/connect-mysql.php');
$sql3="SELECT upper FROM armor Order by grade asc, upper asc";
$results = mysqli_query($dbcon,$sql3) or die();
while($row = mysqli_fetch_array($results)) {
echo '<option value="'.$row['upper'].'">'.htmlspecialchars($row['upper']).'</option>';
}
?>
</select>
</td>
</tr>
<tr>
<th>Lower Body</th>
<td><select size="1" name="Mainlowertype">
<option value="" selected>Select Your Main Class Lower Armor</option>
<?php
include('../../lib/connections/connect-mysql.php');
$sql3="SELECT lower FROM armor Order by grade asc, lower asc";
$results = mysqli_query($dbcon,$sql3) or die();
while($row = mysqli_fetch_array($results)) {
echo '<option value="'.$row['lower'].'">'.htmlspecialchars($row['lower']).'</option>';
}
?>
</select>
</td>
</tr>
<tr>
<th>Helm</th>
<td><select size="1" name="Mainheadtype">
<option value="" selected>Select Your Main Class Helmet Armor</option>
<?php
include('../../lib/connections/connect-mysql.php');
$sql3="SELECT head FROM armor Order by grade asc, head asc";
$results = mysqli_query($dbcon,$sql3) or die();
while($row = mysqli_fetch_array($results)) {
echo '<option value="'.$row['head'].'">'.htmlspecialchars($row['head']).'</option>';
}
?>
</select>
</td>
</tr>
<tr>
<th>Hands</th>
<td><select size="1" name="Mainhandtype">
<option value="" selected>Select Your Main Class Glove Armor</option>
<?php
include('../../lib/connections/connect-mysql.php');
$sql3="SELECT hands FROM armor Order by grade asc, hands asc";
$results = mysqli_query($dbcon,$sql3) or die();
while($row = mysqli_fetch_array($results)) {
echo '<option value="'.$row['hands'].'">'.htmlspecialchars($row['hands']).'</option>';
}
?>
</select>
</td>
</tr>
<tr>
<th>Feet</th>
<td><select size="1" name="Mainfoottype">
<option value="" selected>Select Your Main Class Boot Armor</option>
<?php
include('../../lib/connections/connect-mysql.php');
$sql3="SELECT feet FROM armor Order by grade asc, feet asc";
$results = mysqli_query($dbcon,$sql3) or die();
while($row = mysqli_fetch_array($results)) {
echo '<option value="'.$row['feet'].'">'.htmlspecialchars($row['feet']).'</option>';
}
?>
</select>
</td>
</tr>
</table>
<input type="submit" value="Insert Info"></p>
<input type="hidden" name="submitted" value="true" />
</form>
So what i'm hoping to do is... if for example the player were to select 'Eternal Breastplate' from the first menu (upper) the others would fill with the matching set pieces (Eternal gaiters, eternal gauntlets etc.)
In the database the corresponding pieces to the set share the same record if this makes it any helpful
If there may be some easier way to do this that I cant find or that you know of please indulge me a link <3
thankyou so very much for your time and help in advance once again