mysql 修改表
我通过 phpmyadmin 将下面的 mysql 更改代码一一删除到数据库,它工作正常,有没有人可以帮助我如何一次将它们全部删除?或者您知道可以执行它的 PHP 代码示例吗?请告诉我。
ALTER TABLE `user` ADD `title`
varchar(16) COLLATE utf8_bin NOT NULL DEFAULT '' AFTER `user_id`
ALTER TABLE `customer` ADD `title`
varchar(16) COLLATE utf8_bin NOT NULL DEFAULT '' AFTER `customer_id`;
ALTER TABLE `customer` ADD `date_birtdate` datetime NOT NULL
DEFAULT '0000-00-00 00:00:00' AFTER `lastname`;
ALTER TABLE `customer` ADD `security_question` varchar(96) COLLATE utf8_bin
NOT NULL DEFAULT '' AFTER `fax`;
ALTER TABLE `customer` ADD `security_answer` varchar(96) COLLATE utf8_bin
NOT NULL DEFAULT '' AFTER `fax`;
ALTER TABLE `customer` ADD `pin_number` text COLLATE utf8_bin AFTER `password`;
ALTER TABLE `customer` ADD `notes` text COLLATE utf8_bin AFTER `bank_number`;
ALTER TABLE `customer` ADD `last_active` datetime NOT NULL
DEFAULT '0000-00-00 00:00:00' AFTER `date_added`;
I drop the mysql alter code below to database via phpmyadmin one by one, it it work fine, is there anyone could help me how to drop it all together at once? Or do you know the the samples of PHP code that may execute it? Just let me know please.
ALTER TABLE `user` ADD `title`
varchar(16) COLLATE utf8_bin NOT NULL DEFAULT '' AFTER `user_id`
ALTER TABLE `customer` ADD `title`
varchar(16) COLLATE utf8_bin NOT NULL DEFAULT '' AFTER `customer_id`;
ALTER TABLE `customer` ADD `date_birtdate` datetime NOT NULL
DEFAULT '0000-00-00 00:00:00' AFTER `lastname`;
ALTER TABLE `customer` ADD `security_question` varchar(96) COLLATE utf8_bin
NOT NULL DEFAULT '' AFTER `fax`;
ALTER TABLE `customer` ADD `security_answer` varchar(96) COLLATE utf8_bin
NOT NULL DEFAULT '' AFTER `fax`;
ALTER TABLE `customer` ADD `pin_number` text COLLATE utf8_bin AFTER `password`;
ALTER TABLE `customer` ADD `notes` text COLLATE utf8_bin AFTER `bank_number`;
ALTER TABLE `customer` ADD `last_active` datetime NOT NULL
DEFAULT '0000-00-00 00:00:00' AFTER `date_added`;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在每个查询末尾添加
;
;-) 然后你可以将它们放在一起作为一个块。使用 php 你不能那么简单地做到这一点。add
;
at end of each query ;-) then u can put them together as one block. with php you can't do it that easy way.