as for your errors, session_start() needs to be at the very beginning of your script. If this script is in an include, put it at the top of whatever script is including it. It can have no whitespace before it. if this is part of an html file part way down, open your php tags at the very beginning, session_start() and close them. http://us3.php.net/manual/en/function.session-start.php
also, additional code changes:
Code: Select all
<?php
$query = "SELECT Name,Phone,Email FROM contact ";
session_start();//move to beginning of code!!
$_SESSION['sortMe']="name";
if(isset($_GET['sort'])) {
$_SESSION['sortMe']=$_GET['sort'];
$query.="ORDER BY $_SESSION[sortMe]"; //changed to sortMe
}
?>