How do I add new column with no fields generated? It would be a new column added without the rows. I don't want NULL or empty values...
Is that possible?
This will create NULL values:
$sql = "ALTER TABLE translation ADD new_column VARCHAR( 255 )";
How do I add new column with no fields generated? It would be a new column added without the rows. I don't want NULL or empty values...
Is that possible?
This will create NULL values:
$sql = "ALTER TABLE translation ADD new_column VARCHAR( 255 )";
You can use either "not null" or "default" thingie. Or them both.
ALTER TABLE `translation `
ADD COLUMN `new_column` VARCHAR(45) NOT NULL DEFAULT '1234' AFTER `courier_id`;
"NOT NULL" will prevent the column of having null state ever, and the "DEFAULT" will set a default value.