I'm trying to write an update mysql statement for a software program. Currently this is what I have for the statment, but I don't now how to add multiple columns to update.
This code currently adds the column whether it's there or not.
/*delimiter '//'
CREATE PROCEDURE addcol() BEGIN
IF NOT EXISTS(
SELECT * FROM information_schema.COLUMNS
WHERE COLUMN_NAME=`top_status` AND TABLE_NAME='categories'
)
THEN
ALTER TABLE `categories`
ADD COLUMN `top_status` tinyint(1) NOT NULL default '1';
END IF;
END;
delimiter ';'
CALL addcol();
DROP PROCEDURE addcol;*/
Can someone supply me with the correct statement to get something like this to work...ie. WHERE COLUMN_NAME = column1, column2 etc..
I've tried all kinds of variations and all of them return an error in phpmyadmin except the above.