Every time you call mysql_fetch_array(), you "move" the query result row pointer to the next row. Since you call mysql_fetch_array() right after your "// start loop" comment, but then have a separate for loop inside of that loop where you call mysql_fetch_array() to actually output data, that internal loop will start with the second result row. A better structure would be
if(mysql_num_rows($sql)) // we got some results
{
print '<table width="100%" border="0" cellpadding="4" cellspacing="0" >';
$i = 0;
while($row = mysql_fetch_array($sql))
{
if($i++ % 2)
{
print '<tr class="pink">';
}
else
{
print '<tr class="wight">';
}
//the output//
printf("<td>%s</td><td>%s</td></tr>", $row["3"], $row["2"]);
}
print '</table>';
}
else
{
print '<p class="error">Sorry, no data was found.</p>';
}