$key_answer = 'answer'.$question_num; $test_question = mysql_query('DESCRIBE question_manage {$key_question}'); $test_question = mysql_fetch_array($test_question); if(!is_array($test_question)){ mysql_query("ALTER TABLE `question_manage` ADD `{$key_question}` VARCHAR( 500 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL "); }