Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in select
This is my code where I am connecting the database through object and class.
$this->db_connection($app_config['database']);
$this->table_name = $app_config['database']['tbl_prefix'].strtolower(get_class($this));
$column_q = $this->query("SHOW COLUMNS FROM {$this->table_name}");
while($rows = mysql_fetch_array($column_q)){ #error showing in this line
$column[] = $rows['Field'];
if($rows['Field'] == 'PRI'){
$this->primary_key = $rows['Field'];
}
}
It is showing some error like
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in
can some one tell me what is the error and how to fix this?