I do feel a little guilty asking these questions but after 2 days I'm considering that I may not be up for this. Anyway... I shall ask.
After progressive reading I've delved into building this over two php files. The end result should be to see the results of a table pertaining to a particular selection. It all goes well up until it is required to display the form and it appears blank.
Here are the files:
Code:
<?
require ("actdb.php");
$query = "SELECT DISTINCT name FROM combatant_table WHERE damage!=0 AND ally='T'";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
$name[] = $row['name'];
}
?>
<form action="encounter_table2.php" name="name" method="post">
<select name="name" size="1" id="name">
<?
$option = "<option value=\"Please select a Category\">Please select a Category</option> \n";
for ($i = 0; $i < count($name); $i++) {
$option .= "<option ";
$option .= "value=\"$name[$i]\">$name[$i]</option> \n"; }
echo $option;
?>
</select>
<input type="submit" value="submit" name="submit">
</form> Which should all output to:
Code:
<?php
include 'actdb.php';
$toon_name=$_GET["name"];
$query = "SELECT * FROM encounter_table WHERE name=" . $toon_name;
$result = mysql_query($query);
$name[] = $row['name'];
echo "<table border='1'>";
echo "<tr><th>Title</th><th>Start</th><th>End</th><th>Duration</th><th>Damage</th><th>ExtDPS</th><tr>";
$escapedurl = htmlentities("combatant_table.php?encid=$row[0]", ENT_QUOTES);
echo "<tr>" .
"<td><a href='$escapedurl'>$name[1]</a></td>" .
"<td>$name[2]</td>" .
"<td>$name[3]</td>" .
"<td>$name[4]</td>" .
"<td>$name[5]</td>" .
"<td>$name[6]</td>" .
"</tr>";
echo "</table>";
?> I think I'm at the point where my lack of experience has me totally stumped. Any help will be much appreciated.