Hello,
I'm relatively new at PHP/MySql, I need to sort the results of a query a display it on the screen. The book I am using is somewhat lacking in 'Real World' examples. I have included the code below. Any Help is appreciated.....
<?
require("connect.php");
$result = mysql(jvstudios_com, "select * from contacts");
$num_results = mysql_num_rows($result);
for ($i=0; $i <$num_results; $i++)
{
$num=mysql_result($result,$i,"RecNum");
$first=mysql_result($result,$i,"First");
$last=mysql_result($result,$i,"Last");
$em=mysql_result($result,$i,"Email");
$ph=mysql_result($result,$i,"BestNum");
$row = ($num ." " .$first ." " .$last ." " .$em ." ".$ph);
echo"<table width=\"100%\" border=\"1\"bordercolor=\"#006600\">
<tr>";
echo"<td width =\"20%\"> <a href=\"getrecord.php?num=$num\">$first $last</a></td>";
echo"<td width =\"20%\"> $ph</td>";
echo"<td width =\"40%\"> <a href=\"mailto:$em\">$em</a></td>";
echo "</tr>
</table>";
}
?>