PHP and MySQL echoing out a Table
- by user1631702
Okay, so I've done this before, and it worked. I am trying to echo out specific rows on my database in a table. Here is my code:
<?php
$connect = mysql_connect("localhost", "xxx", "xxx") or
die ("Hey loser, check your server connection.");
mysql_select_db("xxx");
$quey1="select * from `Ad Requests`";
$result=mysql_query($quey1) or die(mysql_error());
?>
<table border=1 style="background-color:#F0F8FF;" >
<caption><EM>Student Record</EM></caption>
<tr>
<th>Student ID</th>
<th>Student Name</th>
<th>Class</th>
</tr>
<?php
while($row=mysql_fetch_array($result)){
echo "</td><td>";
echo $row['id'];
echo "</td><td>";
echo $row['twitter'];
echo "</td><td>";
echo $row['why'];
echo "</td></tr>";
}
echo "</table>";
?>
It gives me no errors, but It just shows a blank table with none of these rows.
My Question: How come this wont show any rows in the table, what am I doing wrong?