Hi everyone,
As you may understand I'm pretty bad to programming

and probably what I'm trying to achieve is something "easy "easy "easy" for you but it's turning out to be a nghtmare for me. I've been researching the web for days and can;t find anything that actually fits my needs and what I found I wasn;t able to make it work.
Basically I'm succesflly retrieving data from a ms sql query using php and now the next steps should be:
1. Make my table sortable by clicking on the title of each column
2. Have the lines in the colum coloroued depending on a condition. For example the difference in hours from the last update (one of the field reitrieved from the quesry) and the current time.
3. Have the page autorefreshing.
I'm stuck at the first step.
Any advice is very welcome.
Here is my code so far:
<?php
$myServer = "one";
$myUser = "two";
$myPass = "three";
$myDB = "heat";
//connection to the database
$connection = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
if (!$connection) {
echo "Couldn't make a connection!";
exit;
}
//select a database to work with
$db = mssql_select_db($myDB, $connection);
// test selection
if (!$db) {
echo "Couldn't select database!";
exit;
}
//declare the SQL statement that will query the database
$sql = "SELECT CallLog.CallID, CallLog.Priority, CallLog.Tracker, CallLog.CallStatus, CallLog.ModDate, CallLog.ModTime, CallLog.EndUserCo
FROM heat.dbo.CallLog CallLog
WHERE CallLog.Tracker='four'
AND CallLog.CallStatus <> 'Closed'";
$sql_result = mssql_query($sql,$connection);
echo "<TABLE BORDER=1>";
echo "<TR>
<TH><font color=##0101DF>Ticket</TH>
<th><font color=##0101DF>Priority</TH>
<th><font color=##0101DF>Status</TH>
<th><font color=##0101DF>LastUpdate</TH>
<th><font color=##0101DF>End Customer</TH>
<th><font color=##0101DF>Owner</th>";
while ($row = mssql_fetch_array($sql_result)) {
$call_id = $row["CallID"];
$priority = $row["Priority"];
$tracker = $row["Tracker"];
$status = $row["CallStatus"];
$modified = $row["ModDate"];
$time = $row["ModTime"];
$customer = $row["EndUserCo"];
echo "<TR><TH>$call_id<TH>$priority<TH>$status<TH>$modi fied<TH>$customer<TH>$tracker";
}
echo "</TABLE>";
mssql_free_result($sql_result);
mssql_close($connection);
?>