简体   繁体   English

如何更改表以删除存在的列?

[英]How can I alter a table to drop a column if it exists?

Before you flag this as a duplicate, I've read the other question , and it pertains to a different version of MySQL. 在将其标记为重复之前,我已经阅读了另一个问题 ,它与MySQL的不同版本有关。 I'm running the next up major version: MySQL version 5.0.91-community 我正在运行下一个主要版本: MySQL version 5.0.91-community

I need to drop a column if it exists, and I also need to add a column if not exists. 我需要删除一列(如果存在),并且还需要添加一列(如果不存在)。

How can I go about doing this in PHP? 如何在PHP中执行此操作?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM