$channel=1; var_dump($channel); //Displays database table function displaytable() { // Get all the data from the program table $q = "select * from `program` where channel_id = '$channel'"; $s = mysql_query( $q ) or die( var_dump($q) ); //Creates the table echo "<table class='form2' border='1'>"; echo "<tr><th>Program Title</th> <th>Program Description</th> <th>Date</th> <th>Start Time</th> <th>Finish Time</th> <th>Widescreen</th><th>Subtitles</th></tr>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $s )) { // Print out the contents of each row into a table echo "<tr><td>"; echo $row['program_title']; echo "</td><td>"; echo $row['program_description']; echo "</td><td>"; echo $row['date']; echo "</td><td>"; echo $row['start_time']; echo "</td><td>"; echo $row['finish_time']; echo "</td><td>"; echo $row['widescreen']; echo "</td><td>"; echo $row['subtitles']; echo "</td></tr>"; } echo "</table>"; }