Hi,
Using the following code, how do I create a one column table, with "Firstname, Lastname & Sex" as the heading.
Also, how do I display the row data (i.e Firstname etc) using the following format?:
$record) $Firstname
$Lastname ($Sex)
<link rel="stylesheet" type="text/css" href="Index.css" />
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die(mysql_error());
}
mysql_select_db("WB", $con);
$result = mysql_query("SELECT * FROM Birds");
//This should be the column heading.
echo "Firstname, Lastname & Sex";
$record = 1;
while($row = mysql_fetch_array($result))
{
//Display all this on each row.
echo $record++;
echo $row['Firstname'];
echo $row['Lastname'];
echo $row['Sex'];
}
mysql_close($con);
?>