當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sql::create方法代碼示例

本文整理匯總了PHP中sql::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP sql::create方法的具體用法?PHP sql::create怎麽用?PHP sql::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sql的用法示例。


在下文中一共展示了sql::create方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: int

<?php

/************************************************************************
 * Dashboard2
 * Copyright 2006-2010 by Niels Leenheer
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.	 
 */
sql::create("contents_movie", "\r\n\t\t`ID` int(11) NOT NULL default '0',\r\n\t\t`revision` int(11) NOT NULL default '0',\r\n\t\t`filename` varchar(128) NOT NULL default '',\r\n\t\t`type` varchar(128) NOT NULL default '',\r\n\t\t`name` varchar(255) default NULL,\r\n\t\t`size` int(32) default NULL,\r\n\t\t`width` int(11) NOT NULL default '0',\r\n\t\t`height` int(11) NOT NULL default '0',\r\n\t\t`autostart` int(11) NOT NULL default '0',\r\n\t\tUNIQUE KEY `id_revision` (`ID`,`revision`)\r\n\t");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='nl', id='movie', value='Film'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='nl', id='movies', value='Films'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='nl', id='erroruploadmovie', value='Er is een fout opgestreden tijdens het toevoegen van de film'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='nl', id='moviesize', value='Grootte'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='nl', id='moviebig', value='Groot (640 x 480 pixels)'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='nl', id='moviesmall', value='Klein (320 x 240 pixels)'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='nl', id='movieautostart', value='Start de film automatisch'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='en', id='movie', value='Movie'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='en', id='movies', value='Movies'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='en', id='erroruploadmovie', value='An error occurred while uploading the movie'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='en', id='moviesize', value='Size'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='en', id='moviebig', value='Large (640 x 480 pixel)'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='en', id='moviesmall', value='Small (320 x 240 pixel)'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='en', id='movieautostart', value='Automatically start the movie'");
開發者ID:KasaiDot,項目名稱:Dashboard2,代碼行數:25,代碼來源:install.php

示例2: int

<?php

/************************************************************************
 * Dashboard2
 * Copyright 2006-2010 by Niels Leenheer
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.	 
 */
sql::create("contents_external", "\r\n\t\t`ID` int(11) NOT NULL default '0',\r\n\t\t`revision` int(11) NOT NULL default '0',\r\n\t\t`url` text NOT NULL default '',\r\n\t\tUNIQUE KEY `id_revision` (`ID`,`revision`)\r\n\t");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='nl', id='external', value='Extern'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='en', id='external', value='External'");
開發者ID:KasaiDot,項目名稱:Dashboard2,代碼行數:13,代碼來源:install.php

示例3: int

<?php

/************************************************************************
 * Dashboard2
 * Copyright 2006-2010 by Niels Leenheer
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.	 
 */
if (!sql::exists("media")) {
    sql::create("media", "\r\n\t\t\t`ID` int(11) NOT NULL auto_increment,\r\n\t\t\t`folder` int(11) NOT NULL default '0',\r\n\t\t\t`filename` varchar(255) NOT NULL default '',\r\n\t\t\t`original` varchar(255) NOT NULL default '',\r\n\t\t\t`width` int(11) NOT NULL default '0',\r\n\t\t\t`height` int(11) NOT NULL default '0',\r\n\t\t\t`size` int(11) NOT NULL default '0',\r\n\t\t\t`modified` datetime NOT NULL default '0000-00-00 00:00:00',\r\n\t\t\t`deleted` int(4) NOT NULL default '0',\r\n\t\t\tPRIMARY KEY  (`ID`)\r\n\t\t");
    sql::create("media_folder", "\r\n\t\t\t`ID` int(11) NOT NULL auto_increment,\r\n\t\t\t`order` int(11) NOT NULL default '0',\r\n\t\t\t`name` varchar(50) NOT NULL default '',\r\n\t\t\tPRIMARY KEY  (`ID`)\r\n\t\t");
    /* Create or first folder */
    sql::query("INSERT INTO " . _TABLE_PREFIX_ . "media_folder SET `ID`=1, `order`=0, `name`='Standard'");
}
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='nl', id='image', value='Afbeelding'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='nl', id='selectimage', value='Selecteer afbeelding'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='nl', id='imagesonwebsite', value='Afbeeldingen op uw website'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='en', id='image', value='Image'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='en', id='selectimage', value='Select image'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='nl', id='imagesonwebsite', value='Images on your website'");
開發者ID:KasaiDot,項目名稱:Dashboard2,代碼行數:22,代碼來源:install.php

示例4: varchar

sql::create("plugins_event", "\r\n\t\t`name` varchar(254) NOT NULL default '',\r\n\t\t`plugin` varchar(254) NOT NULL default '',\r\n\t\tPRIMARY KEY  (`name`(128),`plugin`(128))\r\n\t");
sql::create("plugins_types", "\r\n\t\t`ID` varchar(254) NOT NULL default '',\r\n\t\t`plugin` varchar(254) NOT NULL default '',\r\n\t\t`children_allowed` text NOT NULL default '',\r\n\t\t`parents_allowed` text NOT NULL default '',\r\n\t\t`root_allowed` int(11) NOT NULL default '1',\r\n\t\t`visible` int(11) NOT NULL default '1',\r\n\t\tPRIMARY KEY  (`ID`)\r\n\t");
if (!sql::exists("types")) {
    sql::create("types", "\r\n\t\t\t`ID` int(11) NOT NULL auto_increment,\r\n\t\t\t`name` varchar(254) NOT NULL default '',\r\n\t\t\t`children_allowed` text NOT NULL default '',\r\n\t\t\t`parents_allowed` text NOT NULL default '',\r\n\t\t\t`root_allowed` int(11) NOT NULL default '1',\r\n\t\t\t`visible` int(11) NOT NULL default '1',\r\n\t\t\t`sort` int(11) NOT NULL default '0',\r\n\t\t\tPRIMARY KEY  (`ID`)\r\n\t\t");
    sql::create("types_groups", "\r\n\t\t\t`type` int(11) NOT NULL default '0',\r\n\t\t\t`group` int(11) NOT NULL default '0',\r\n\t\t\t`content` text NOT NULL,\r\n\t\t\tPRIMARY KEY  (`type`,`group`)\r\n\t\t");
    /* Create the default pagetype */
    sql::query("\r\n\t\t\tINSERT INTO " . _TABLE_PREFIX_ . "types SET \r\n\t\t\t\t`ID`=1, `name`='Default', `children_allowed`= '*', `parents_allowed`= '*', `root_allowed`= 1\r\n\t\t");
    sql::query("\r\n\t\t\tINSERT INTO " . _TABLE_PREFIX_ . "types_groups SET \r\n\t\t\t\t`type`=1, `group`=0, `content`= 'title,story'\r\n\t\t");
}
/* Basic tables */
sql::create("config", "\r\n\t\t`name` varchar(254) NOT NULL default '',\r\n\t\t`type` varchar(254) NOT NULL default '',\r\n\t\t`data` text NOT NULL,\r\n\t\tPRIMARY KEY  (`name`)\r\n\t");
sql::create("tickets", "\r\n\t\t`ticket` varchar(64) NOT NULL default '',\r\n\t\t`id` int(64) NOT NULL default '0',\r\n\t\t`generated` datetime NOT NULL default '0000-00-00 00:00:00'\r\n\t");
/* Translation and languages */
if (!sql::exists("language")) {
    sql::create("language", "\r\n\t\t\t`id` char(2) NOT NULL default '',\r\n\t\t\t`name` varchar(50) NOT NULL default '',\r\n\t\t\t`public` int(4) NOT NULL default '0',\r\n\t\t\t`position` int(11) NOT NULL default '0',\r\n\t\t\t`site` int(11) NOT NULL default '0',\r\n\t\t\tUNIQUE KEY `id_site` (`id`,`site`)\r\n\t\t");
    /* Create our default language */
    sql::query("INSERT INTO " . _TABLE_PREFIX_ . "language SET `id`='" . _DEFAULT_LANGUAGE_ . "', `name`='" . _DEFAULT_LANGUAGE_NAME_ . "', `public`=1,  `site`=" . _DEFAULT_SITE_);
}
sql::create("strings", "\r\n\t\t`id` varchar(255) NOT NULL default '',\r\n\t\t`language` varchar(5) NOT NULL default '',\r\n\t\t`value` text NOT NULL,\r\n\t\t`group` varchar(64) NOT NULL default '',\r\n\t\tUNIQUE KEY `id_language` (`id`,`language`)\r\n\t");
sql::create("strings_groups", "\r\n\t\t`group` varchar(64) NOT NULL default '',\r\n\t\t`name` varchar(255) NOT NULL default '',\r\n\t\tPRIMARY KEY  (`group`)\r\n\t");
/* Content */
if (!sql::exists("contents")) {
    sql::create("contents", "\r\n\t\t\t`ID` int(11) NOT NULL auto_increment,\r\n\t\t\t`parent` int(11) NOT NULL default '0',\r\n\t\t\t`left` int(11) NOT NULL default '0',\r\n\t\t\t`right` int(11) NOT NULL default '0',\r\n\t\t\t`site` int(11) NOT NULL default '0',\r\n\t\t\t`name` varchar(254) NOT NULL default '',\r\n\t\t\t`title` varchar(254) NOT NULL default '',\r\n\t\t\t`slug` varchar(254) NOT NULL default '',\r\n\t\t\t`type` varchar(64) NOT NULL default '',\r\n\t\t\t`revision` int(11) NOT NULL default '0',\r\n\t\t\t`status` int(11) NOT NULL default '0',\r\n\t\t\t`set` int(11) NOT NULL default '0',\r\n\t\t\t`position` int(11) default NULL,\r\n\t\t\t`r_view` int(11) NOT NULL default '0',\r\n\t\t\t`r_view_inv` int(11) NOT NULL default '0',\r\n\t\t\t`r_edit` int(11) NOT NULL default '0',\r\n\t\t\t`r_edit_inv` int(11) NOT NULL default '0',\r\n\t\t\t`r_create` int(11) NOT NULL default '0',\r\n\t\t\t`r_create_inv` int(11) NOT NULL default '0',\r\n\t\t\t`r_admin` int(11) NOT NULL default '0',\r\n\t\t\t`r_admin_inv` int(11) NOT NULL default '0',\r\n\t\t\t`author` int(11) NOT NULL default '0',\r\n\t\t\t`language` char(2) NOT NULL default 'nl',\r\n\t\t\t`activation` int(11) NOT NULL default '0',\r\n\t\t\t`expiration` int(11) NOT NULL default '0',\r\n\t\t\t`created` int(11) NOT NULL default '0',\r\n\t\t\t`published` int(11) NOT NULL default '0',\r\n\t\t\t`modified` int(11) NOT NULL default '0',\r\n\t\t\t`visible` int(11) NOT NULL default '1',\r\n\t\t\tPRIMARY KEY  (`ID`)\r\n\t\t");
    /* Create the default homepage */
    sql::query("\r\n\t\t\tINSERT INTO " . _TABLE_PREFIX_ . "contents SET \r\n\t\t\t\t`ID`=1, `parent`=0, `left`=1, `right`=2, `site`=" . _DEFAULT_SITE_ . ", `name`='Home', `title`='', `slug`='index', `type`='1', `revision`=0, \r\n\t\t\t\t`status`=1, `set`=0, `position`=0, `r_view`=3, `r_view_inv`=0, `r_edit`=6, `r_edit_inv`=0, `r_create`=6, `r_create_inv`=0,\r\n\t\t\t\t`r_admin`=6, `r_admin_inv`=0, `author`=1, `language`='" . _DEFAULT_LANGUAGE_ . "', \r\n\t\t\t\t`activation`=0, `expiration`=0, `created`= " . time() . ", `published` = " . time() . ", `modified`= " . time() . ", \r\n\t\t\t\t`visible`=1\r\n\t\t");
}
if (!sql::exists("contents_revisions")) {
    sql::create("contents_revisions", "\r\n\t\t\t`ID` int(11) NOT NULL default '0',\r\n\t\t\t`revision` int(11) NOT NULL default '0',\r\n\t\t\t`created` int(11) NOT NULL default '0',\r\n\t\t\t`modified` int(11) NOT NULL default '0',\r\n\t\t\t`description` text NOT NULL,\r\n\t\t\t`author` int(11) NOT NULL default '0',\r\n\t\t\tUNIQUE KEY `id_revision` (`ID`,`revision`)\r\n\t\t");
    /* Create the default homepage */
    sql::query("\r\n\t\t\tINSERT INTO " . _TABLE_PREFIX_ . "contents_revisions SET \r\n\t\t\t\t`ID`=1, `revision`=0, `created`= " . time() . ", `modified`= " . time() . ", `author`=1\r\n\t\t");
}
開發者ID:KasaiDot,項目名稱:Dashboard2,代碼行數:31,代碼來源:create-database.php

示例5: int

<?php

/************************************************************************
 * Dashboard2
 * Copyright 2006-2010 by Niels Leenheer
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.	 
 */
sql::create("contents_seo", "\r\n\t\t`ID` int(11) NOT NULL default '0',\r\n\t\t`revision` int(11) NOT NULL default '0',\r\n\t\t`keywords` text NOT NULL,\r\n\t\t`description` text NOT NULL,\r\n\t\tUNIQUE KEY `id_revision` (`ID`,`revision`)\r\n\t");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='nl', id='seo', value='SEO'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='nl', id='keywords', value='Sleutelwoorden'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='nl', id='description', value='Beschrijving'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='en', id='seo', value='SEO'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='en', id='keywords', value='Keywords'");
sql::query("INSERT INTO " . _TABLE_PREFIX_ . "strings SET language='en', id='description', value='Description'");
開發者ID:KasaiDot,項目名稱:Dashboard2,代碼行數:17,代碼來源:install.php


注:本文中的sql::create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。