I'm trying pull up data from database, and display it on a table. I used this code before but for some reason it won't work here. Any suggestions? Thanks!
It says the error is this line: <?php while ($list = mysql_fetch_assoc($result)) {?>
The error message is: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /Users/laurenyoung/Sites/runners.php on line 60
<?php
// Include connection to your database
$con = mysql_connect("","","");
mysql_select_db("RUNNERS", $con);
$name = $_POST['name'];
$query = "SELECT * FROM runners WHERE id = '$name'";
$result = mysql_query($query);?>
<table class="sortable">
<!-- Table Header -->
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>1 Mile</th>
<th>2 Mile</th>
<th>5k</th>
<th>8k</th>
<th>10k</th>
<th>15k</th>
<th>20k</th>
<th>13.1</th>
<th>25k</th>
<th>26.2</th>
</tr>
</thead>
<!-- Table body-->
<tbody>
<?php while ($list = mysql_fetch_assoc($result)) {?>
<tr>
<th><?php echo $list['first_name'] ?></th>
<th><?php echo $list['last_name'] ?></th>
<th><?php echo $list['1_mile'] ?></th>
<th><?php echo $list['2_mile'] ?></th>
<th><?php echo $list['5k'] ?></th>
<th><?php echo $list['8k'] ?></th>
<th><?php echo $list['10k'] ?></th>
<th><?php echo $list['15k'] ?></th>
<th><?php echo $list['20k'] ?></th>
<th><?php echo $list['half'] ?></th>
<th><?php echo $list['25k'] ?></th>
<th><?php echo $list['full'] ?></th>
</tr>
<?php } ?>
</tbody>
</table>