Ok - last question, I promise.
I have a form that lets me search for all characters of a particular role (tank, healer, etc), withing a chosen class - ie., I can search for all paladin tanks. I've been trying to set an option in the class drop-down menu that will select all classes, thereby returning, say, a list of all tanks, regardless of their class. I had thought that having * as the value of the select all option of the form would work, but it doesnt.
here's the relevant bit of the form:
Code: Select all
<form action="multi_search.php" method="post">
<p>
<label for="class">Pick the class:</label>
<select id="class" name="class">
<option value="*">All Classes</option>
<option value="Paladin">Paladin</option>
<option value="Hunter">Hunter</option>
<option value="Death Knight">Death Knight</option>
<option value="Shamen">Shamen</option>
<option value="Priest">Priest</option>
<option value="Druid">Druid</option>
<option value="Mage">Mage</option>
<option value="Warlock">Warlock</option>
<option value="Rogue">Rogue</option>
<option value="Warrior">Warrior</option>
</select>
</label>
</p>
and the relevant bit of the script to process it:
Code: Select all
<?php
$class = $_POST['class'];
$role = $_POST['role'];
$eg_ready = $_POST['eg_ready'];
include ("connect.php");
$result1 = mysql_query("SELECT * from `character` WHERE max_lvl='Yes' AND ((role1='$role' AND class='$class' AND r1eg='$eg_ready') OR (role2='$role' AND class='$class' AND r2eg='$eg_ready'))");
echo "<table border='1'>
<tr>
<th>Character</th>
<th>Class</th>
</tr>";
while($row = mysql_fetch_array($result1))
{
echo "<tr>";
echo '<td><a href="http://www.wow-heroes.com/index.php?zone=eu&server=eonar&name=' . $row['char1'] . '">' . $row['char1'] . '</a></td>';
echo "<td>" . $row['class'] . "</td>";
echo "<br />";
}
I had assumed that sending * to $class would select all classes - where am I going wrong?