This is what I ahve:
<tr>
<td colspan="2">
<? $db2 =& DB::connect($dsn, $options);
if (DB::isError($db2)) {
die($db2->getMessage());
}
print_r ($boardtype);
$count_board = count($boardtype);
$i=0;
for($i; $i < $count_board; $i++):
$sql2 = "SELECT * FROM trustees_board WHERE board_type=".$boardtype[$i]." Order By board_type";
print $sql2;
$result2 =& $db->query($sql2)
or die ("couldn't execute query.");
endfor;
if (DB::isError($result2)) {
die($result2->getMessage());
}
$n=1;
$color='row2';
$flag=1;
?>
<table width="50%" border="0" cellspacing="0" cellpadding="2" class="border">
<tr align="center" bgcolor="#FFFFFF">
<td width="15%" class="th">Name</td>
<td width="16%" class="th">Type</td>
</tr>
<? while ($row2 =& $result2->fetchRow(DB_FETCHMODE_ASSOC)): ?>
<tr align="center">
<td class="<? echo $color;?>"><? echo $row2['board_name'];?></td>
<td class="<? echo $color;?>"><? echo $row2['board_type'];?></td>
</tr>
<? $n++;
if ($flag):
$color='row1';
else:
$color='row2';
endif;
$flag=!$flag;
endwhile; ?>
</table></td>
</tr>
I want it to display the table by pulling data when the board_type in the database = whats in the boardtype array. I keep on getting a syntax error, and the table does not display, I am new at this, Thanks!