Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in select
How would you print the names of a table where a value in a field matches the value of a variable. i have a bit of code:
$query = "select * from event WHERE eventname = $eventname";
$result = mysql_query($query);
$numcolumn = mysql_num_fields($result);
for ( $i = 8; $i < $numcolumn; $i++ ) {
$columnnames = mysql_field_name($result, $i);
echo $columnnames . "<br />";
}
this gives me the following error:
Warning: mysql_num_fields() expects parameter 1 to be resource, boolean given in /var/www/sportevent/eventform.php on line 196