EEK! I can't get this to run properly. I have "tblColors" as my table with the following fields:
COLOR
CODE
GROUP
DESCRIPTION
TEXTURE
All I want to do is select the COLOR and DESCRIPTION fields and list the two in a table sorted by COLOR.
I created this script and it only picks up the DESCRIPTION field and omits the display of the COLOR field.
<?php
$db = mysql_connect("localhost", "username", "password");
mysql_select_db("colors",$db);
$result = mysql_query("SELECT COLOR, DESCRIPTION FROM tblColors ORDER BY COLOR",$db);
echo "<table border=0>\n";
echo "<tr><td><font face=verdana size=2><B>COLOR</B></font></td><td><font face=verdana
size=2><B>DESC</b></font></td></tr>\n";
while ($myrow = mysql_fetch_row($result))
{
printf("<tr><td><font face=verdana size=1>%s</font></td><td><font face=verdana
size=2>%s</font></td></tr>\n", $myrow[1], $myrow[2]);
}
echo "</table>\n";
?>
What am I doing wrong?