I want check, exists or not in mytable column “auto”, and if not exists, add his. a make this so:
mysql-> SHOW COLUMNS FROM mytable
after, with PHP I check, in result exists or not “auto” and if no, I make:
mysql-> ALTER TABLE mytable ADD auto VARCHAR (30) NOT NULL COLLATE utf8_general_ci
Question: please tell, how to make this in one query ?
You can define following query in your stored procedure and call the stored procedure to add the column if not exist.