Can someone tell me how to make this script list the priority so that the highest (1) is at the top and the lowest (4) is at the bottom?
Thanks
Heres what i currently have:
<?
function mydbconnect ($hostname,$username,$password,$dbname)
{
$link = @mysql_pconnect("$hostname","$username","$password");
if ($link && mysql_select_db ("$dbname"))
return ($link);
return (FALSE);
}
?>
<?
mydbconnect($hostname,$username,$password,$dbname);
$query = "SELECT * FROM $tablename";
$exec = MYSQL_QUERY($query);
echo '
<head>
<title>HelpDesk Admin Interface</title>
</head>
<body>
<p align="center"><font face="Arial" size="3" color="#000080"><b>HelpDesk Admin
Interface</b></font></p>
<div align="center">
<center>
<table border="1" cellspacing="0" bordercolorlight="#000000">
<tr>
<td><font face="Arial" size="2" color="#008000"><b> Ticket
Number </b></font></td>
<td><font face="Arial" size="2" color="#008000"><b> UserName </b></font></td>
<td><font face="Arial" size="2" color="#008000"><b> Name </b></font></td>
<td><font face="Arial" size="2" color="#008000"><b> Email </b></font></td>
<td><font face="Arial" size="2" color="#008000"><b> Domain </b></font></td>
<td><font face="Arial" size="2" color="#008000"><b> Priority </b></font></td>
<td><font face="Arial" size="2" color="#008000"><b> Status </b></font></td>
<td><font face="Arial" size="2" color="#008000"><b> Date
Submitted </b></font></td>
</tr>
';
while ($row = mysql_fetch_array ($exec)) {
echo '<tr>';
echo '<td align="center"> ' . $row["ticket"] . ' </td>';
echo '<td align="center"> ' . $row["user"] . ' </td>';
echo '<td align="center"> ' . $row["name"] . ' </td>';
echo '<td align="center"> ' . $row["email"] . ' </td>';
echo '<td align="center"> ' . $row["domain"] . ' </td>';
echo '<td align="center"> ' . $row["priority"] . ' </td>';
echo '<td align="center"> ' . $row["status"] . ' </td>';
echo '<td align="center"> ' . $row["date"] . ' </td>';
echo '</tr>';
}
echo '
</table>
</center>
</div>
<p><font size="2" face="Arial">Click on a Ticket Number to view the problem<br>
Once chosen the ticket can be closed and the solution<br>
displayed to the user.</font></p>
</body>
';
mysql_free_result ($exec);
MYSQL_CLOSE();
?>
Thanks
Heres what i currently have:
<?
function mydbconnect ($hostname,$username,$password,$dbname)
{
$link = @mysql_pconnect("$hostname","$username","$password");
if ($link && mysql_select_db ("$dbname"))
return ($link);
return (FALSE);
}
?>
<?
mydbconnect($hostname,$username,$password,$dbname);
$query = "SELECT * FROM $tablename";
$exec = MYSQL_QUERY($query);
echo '
<head>
<title>HelpDesk Admin Interface</title>
</head>
<body>
<p align="center"><font face="Arial" size="3" color="#000080"><b>HelpDesk Admin
Interface</b></font></p>
<div align="center">
<center>
<table border="1" cellspacing="0" bordercolorlight="#000000">
<tr>
<td><font face="Arial" size="2" color="#008000"><b> Ticket
Number </b></font></td>
<td><font face="Arial" size="2" color="#008000"><b> UserName </b></font></td>
<td><font face="Arial" size="2" color="#008000"><b> Name </b></font></td>
<td><font face="Arial" size="2" color="#008000"><b> Email </b></font></td>
<td><font face="Arial" size="2" color="#008000"><b> Domain </b></font></td>
<td><font face="Arial" size="2" color="#008000"><b> Priority </b></font></td>
<td><font face="Arial" size="2" color="#008000"><b> Status </b></font></td>
<td><font face="Arial" size="2" color="#008000"><b> Date
Submitted </b></font></td>
</tr>
';
while ($row = mysql_fetch_array ($exec)) {
echo '<tr>';
echo '<td align="center"> ' . $row["ticket"] . ' </td>';
echo '<td align="center"> ' . $row["user"] . ' </td>';
echo '<td align="center"> ' . $row["name"] . ' </td>';
echo '<td align="center"> ' . $row["email"] . ' </td>';
echo '<td align="center"> ' . $row["domain"] . ' </td>';
echo '<td align="center"> ' . $row["priority"] . ' </td>';
echo '<td align="center"> ' . $row["status"] . ' </td>';
echo '<td align="center"> ' . $row["date"] . ' </td>';
echo '</tr>';
}
echo '
</table>
</center>
</div>
<p><font size="2" face="Arial">Click on a Ticket Number to view the problem<br>
Once chosen the ticket can be closed and the solution<br>
displayed to the user.</font></p>
</body>
';
mysql_free_result ($exec);
MYSQL_CLOSE();
?>