$res = $db->query("select column_name from INFORMATION_SCHEMA.columns where table_name = 'MyTable' and column_name = 'MyColumn'"); if (!$res->num_rows) { $db->query('ALTER TABLE `MyTable` ADD MyColumn varchar(200)'); }