function field_exists ($table,$field) { global $DB_site; $DB_site->reporterror=0; $DB_site->query("SELECT COUNT(".$field.") AS count FROM ".$table); $errno=$DB_site->errno; if (!$errno) { $errno = 0; } $DB_site->reporterror=1; if ($errno) { return 0; } else { return 1; }