I have also adapted using the two variables for the sake of the exercise and get:
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/.lazar/jackaal/aocmaps.threedd.com/aocparse/test.php on line 4
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/.lazar/jackaal/aocmaps.threedd.com/aocparse/test.php on line 5
Quote:
<?
require ("actdb.php");
$query = "SELECT DISTINCT encid, name FROM combatant_table WHERE damage>0 AND ally='T'";
$result = mysql_query($query, $db);
while ($row = mysql_fetch_array($result)) {
$name[] = $row['name'];
$encid[] = $row['encid'];
}
?>
<select name="name" size="1" id="Combobox1">
<?
$option = "<option value=\"Please select a Category\">Please select a Category</option>";
for ($i = 0; $i < count($name); $i++) {
$option .= "<option ";
$option .= "value=\"$encid[$i]\">$name[$i]</option> \n";
}
echo $option;
?>
</select>
|