如果它是multisite的主博客(插件激活时),我想创建一个额外的表字段。
我是说像这样
if (main blog) {
execute this sql;
}
else {
execute this sql
}
PS:这是“执行此sql”的代码。
如果子博客:
$sql = "CREATE TABLE tablename (
id bigint(20) NOT NULL AUTO_INCREMENT,
uid bigint(20) NOT NULL,
type VARCHAR(256) NOT NULL,
data TEXT NOT NULL,
credits bigint(20) NOT NULL,
timestamp bigint(20) NOT NULL,
UNIQUE KEY id (id)
);";
如果主博客:
$sql = "CREATE TABLE tablename (
id bigint(20) NOT NULL AUTO_INCREMENT,
uid bigint(20) NOT NULL,
type VARCHAR(256) NOT NULL,
data TEXT NOT NULL,
credits bigint(20) NOT NULL,
globalcredits bigint(20) NOT NULL,
timestamp bigint(20) NOT NULL,
UNIQUE KEY id (id)
);";
有人能帮我吗?