To answer the question, I don’t see where you’re executing the query.
[php]<?php
/* Variables */
$role = mysql_real_escape_string($_POST[‘selectrole’]);
$email = mysql_real_escape_string($_POST[‘email’]);
$name = mysql_real_escape_string($_POST[‘name’]);
$age = mysql_real_escape_string($_POST[‘age’]);
$query = NULL;
/* Connection to the database */
$server = mysql_connect(“localhost”, “root”, “”) or die(mysql_error());
mysql_select_db(“students”, $server);
/* IF USER CHECKED OPTION 1 */
if(isset($_POST[‘formWheelchair’]) && $_POST[‘formWheelchair’] == ‘Yes’) {
$res = “SELECT * FROM glee WHERE clubrole = ‘$role’”; // need quotes around strings
$query = mysql_query($res); // this is missing in your version
echo "<table>";
/* while loop selects all data in 'twittertable' and fetches rows while thier is still rows to fetch */
while ($row = mysql_fetch_array($query)) {
echo "<tr> <td>" . $row['id'] . "</td> <td>" . $row['firstname'] . "</td> <td>" . $row['lastname'] . "</td></tr>";
}
echo "</table>";
}
mysql_close($server);
?>[/php]