I have a SELECT query and i get "Warning: in_array() [function.in-array]" along with the result. here is the code i have :
<?php
include 'conetcion.php';
$query = "SELECT Sub_Name FROM subject WHERE Prof_Id = 8";
//execute the SQL query and return records
$result=mysql_query($query);
/$nRows = mysql_num_rows($result);
echo $nRows;/
$row = mysql_fetch_assoc ($result);
echo "<TABLE border=1>\n";
echo "<TR>\n";
foreach ($row as $heading=>$column) {
echo "<TD><b>";
if (in_array ($heading, $allowed_order)) {
echo "<a href=\"{$_SERVER['PHP_SELF']}?order=$heading\">$heading</a>";
}
else {
echo $heading;
}
echo "</b></TD>\n";
}
echo "</TR>\n";
mysql_data_seek ($result, 0);
while ($row = mysql_fetch_assoc ($result)) {
echo "<TR>\n";
foreach ($row as $column) {
echo "<TD>$column</TD>\n";
}
echo "</TR>\n";
}
echo "</TABLE>\n";
mysql_free_result($result);
?>
it says that i have Wrong datatype for second argument ..blabla.. - in the IF condition -
if any one knows what's wrong HELP 🙂)