Im trying to add buttons to a web page along with values in a table, althought I cant even get passed the blank page, whats wrong with my code, and can I set a variable on button press?
php:
<?php
$sql_link = mysqli_connect('localhost', 'root', '12buckle', 'GameData');
$SetHomework = mysqli_query($sql_link, "SELECT * FROM tblClassHomework WHERE ClassID ='".$_SESSION['ClassID']."'");
echo "<table border='1'>
<tr>
<th>Name</th>
<th>Deadline</th>
<th>Comment</th>
<th>Play</th>
</tr>";
while($row = mysqli_fetch_array($SetHomework))
{
$SetHomework = mysqli_query($sql_link, "SELECT * FROM tblHomework WHERE HomeworkID='".$row['HomeworkID']."'");
$Homework = mysqli_fetch_array($SetHomework);
echo "<tr>";
echo "<td>" . $Homework['HomeworkName'] . "</td>";
echo "<td>" . $row['Deadline'] . "</td>";
echo "<td>" . $row['Comment'] . "</td>";
echo "<td><form action='index.php' method="post"><input type="submit" name="submit" value="Play"></form></td>";
echo "</tr>";
}
echo "</table>";
?>
My php is inside the html file the table will be presented in
tbl? That seems horribly redundant.