I have this code which I want to show the records of a table and it's giving me a "Parse error: syntax error, unexpected T_STRING", it's saying the error is on this line;
echo "<tr><th align=left>Student Name</th><th align=left>Address</th><th align=left>Phone Number</th><th align=left>Reg-Number</th></tr>\n";
but I cant see it. what is the problem.
<?php
$db = mysql_connect("localhost", "root");
mysql_select_db("membership",$db);
$query = "SELECT * FROM members;
$result = mysql_query($query) or die(mysql_error());
if ($mycolumn = mysql_fetch_array($result)) {
echo "<table border=1 align=center cellspacing=0\n";
echo "<tr><th align=left>Student Name</th><th align=left>Address</th><th align=left>Phone Number</th><th align=left>Reg-Number</th></tr>\n";
do {
printf("<tr><td>%s %s %s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", $mycolumn["title"], $mycolumn["firstname"], $mycolumn["lastname"], $mycolumn["address"],
$mycolumn["phonenumber"], $mycolumn["regnumber"]);
} while ($mycolumn = mysql_fetch_array($result));
//echo "<BR>";
echo "<h3>REGISTERED MEMBERS</h3>";
echo "<BR>";
echo "</table>\n";
} else {
echo "Sorry, no records were found!";
}
?>