Thanks for the suggestions. Looking at those tutorials and a couple of others I now have a table of data displaying fine. I want the user to be able to select order by surname or membership. I am sure I must be able to pass this from a button or link on the html form to the php. I have the order by working fine from a variable what I am having trouble with is passing from the html form the selection order.
This is my current code (not very tidy and I am sure it could be better written but it works):
<?php
$username="root";
$password="";
$database="membership";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die ("Unable to select database");
$order="surname";
$query="SELECT * FROM names order by $order";
$result=mysql_query($query);
echo "<table border=1>\n";
echo "<tr><b><td>Mem.No</td><td>Name</td><td>Surname</td><td>Address</td><td></td><td>Town</td><td>Post Code</td><td>Phone</td><td>Mobile</td><td>email</td><td>Joined</td></b></tr>\n";
while ($myrow = mysql_fetch_row($result)) {
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", $myrow[1], $myrow[2], $myrow[3], $myrow[4], $myrow[5], $myrow[6], $myrow[7], $myrow[8], $myrow[9], $myrow[10], $myrow[11] );
}
echo "</table>\n";
?>
Does anyone have any thoughts on how I can pass the selection to $order?
TIA