Hi, i have a big problem trying to make my table sort things..
Table information is cooming from mysql db..
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Min telefonbok</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<h1>Telefonbok</h1>
<form id="form" method="post" action="phonebook.php">
<fieldset>
<legend>Skapa ny kontakt</legend>
<table>
<tr>
<th>Kontakter</th>
</tr>
<tr>
<td>Förnamn</td>
<td><input name="fnamn" type="text" id="fnamn" /></td>
</tr>
<tr>
<td>Efternamn</td>
<td><input name="enamn" type="text" id="enamn" /></td>
</tr>
<tr>
<td>Telefonnummer</td>
<td><input name="telefonnummer" type="text" id="telefonnummer" value="" /></td>
</tr>
<tr>
<td>Beskrivning</td>
<td><textarea rows="10" cols="30" id="beskrivning" name="beskrivning" >
</textarea></td>
</tr>
<tr>
<td><label for="favorit">Favorit?</label></td>
<td><input name="favorit" type="checkbox" id="favorit" value="1" /></td>
</tr>
<tr>
<td><input name="save" type="submit" id="save" value="Save" /></td>
<td><input type="reset" name="reset" value="Reset" /></td>
</tr>
</table>
</fieldset>
</form>
<?php
$dbh=mysql_connect("localhost","xxxxx","xxxxxx") or die (mysql_error());
mysql_select_db("xxxxxx") or die(mysql_error());
$enamn = mysql_query("SELECT * FROM contacts ORDER BY lastname");
echo "<table border='1'>";
echo "<tr> <th>Efternamn</th> <th>Förnamn</th> <th>Beskrivning</th> <th>Telefonnummer</th> <th>Favorit?</th></tr>";
while ($row = mysql_fetch_array($enamn))
{
echo "<tr><td>";
echo $row['lastname'];
echo "</td><td>";
echo $row['firstname'];
echo "</td><td>";
echo $row['description'];
echo "</td><td>";
echo $row['phonenumber'];
echo "</td><td>";
echo $row['favorite'];
echo "</td></tr>";
}
echo "</table>";
?>
</body>
</html>