Answer the question
In order to leave comments, you need to log in
How to check if a field exists in a table?
There is a table test_category, how to check the existence of a category in it, so as not to try to add an already existing one on a new one?
$id = 'test';
$db->query( "SELECT * FROM " . PREFIX . "_category WHERE alt_name='$id'" );
while ( $row = $db->get_row() ) {
$cat_info[$row['alt_name']] = array ();
....
}
Answer the question
In order to leave comments, you need to log in
Another solution to the problem, check
SHOW COLUMNS FROM `category` LIKE 'alt_name';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question