So what I want is to extract a value from a query while its in an array and then run it through an if/else statement. The reason is, when I return the query, I run it through a for loop and build a table out of it, alternating the row color by:
$row_color = ($row_count % 2) ? $color1 : $color2;
Instead, I want to test the value for 'tech' returned by:
$query = "SELECT id,accountName,taskNumber,dueDateShort,dueTime,ampm,firm,tech,
taskDescription,created,createdBy,edited,editedBy,edits
FROM openOrders ORDER BY dueDateShort";
$result = mysql_query($query);
and set the row color based on the name returned. My loop is set up like:
echo "<table border='0'>
<thead>
<tr>";
for($i = 0;$i < mysql_num_fields($result);$i++)
{
echo "<th><FONT size=1 FACE=sans-serif, Arial, Helvetica, Geneva>".mysql_field_name($result,$i).
"</FONT></th>";
}
echo " </tr>
</thead>
<tbody>";
for ($i = 0; $i < mysql_num_rows($result); $i++)
{
echo "<tr>";
$row = mysql_fetch_array($result);
$taskNumber = $row['taskNumber'];
$index = $row['id'];
for($j = 0;$j<mysql_num_fields($result);$j++)
{
$row_color = ($row_count % 2) ? $color1 : $color2;
echo("<td bgcolor=$row_color><a href='editOrder.php?taskNumber=". $taskNumber . "&id=" . $index . "' target='_self'><FONT size=2 COLOR=#00000 FACE=sans-serif, Arial, Helvetica, Geneva>" . $row[$j] . "</FONT></td>");
}
echo "</tr>";
$row_count++;
}
Thanks everyone!