ZBlogPHP如何给某一指定数据表添加字段的代码

在zblog应用开发中,我们时常会为一些数据表添加一些指定的字段,已变标记调用,那么该怎样实现呢?

方法如下,以文章数据表

zbp_post为例:

function InstallPlugin_themeol(){                                                                                                                                                                                                               
    global $zbp;                                                                                                                                             
    $zbp->db->QueryMulit("ALTER TABLE {$zbp->table['Post']} ADD COLUMN log_Themeol tinyint(1) not null default 0");}

注释说明:

$zbp->table['Post'] 文章数据表,log_Themeol 字段名,tinyint(1) 字段类型,not null default 0 默认值0