I have some names stored in a database and this is what I use to access them and submit them through a form.
<form action="takeQuiz.php" method="post" id="takeQuiz">
<?php $singleSQL = mysql_query("SELECT * FROM examtable");
while($row = mysql_fetch_array($singleSQL)){
$examName = $row['name'];
echo '<p><input type="submit" value="'.$examName.'"/>';
} ?>
</form>
Then on the takeQuiz.php I want to set a variable with the value of the submit
$examName = $_POST['.$examName.'];
$otherSQL = mysql_query("SELECT * FROM $examName");