本文整理汇总了PHP中DBManager类的典型用法代码示例。如果您正苦于以下问题:PHP DBManager类的具体用法?PHP DBManager怎么用?PHP DBManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DBManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: executeInner
protected function executeInner()
{
// update user in database
$userid = $this->getUser()->getUserid();
// instantiate db
$dbManager = new DBManager();
// escape strings for insert
$email = $dbManager->escapeString($this->email);
$result = null;
if (!Str::nullOrEmpty($this->password)) {
// they put something in for password, update it
$password = md5($this->password);
$result = mysql_query("UPDATE users SET email='{$email}', password='{$password}' WHERE userid = {$userid}");
} else {
// just update email
$result = mysql_query("UPDATE users SET email='{$email}' WHERE userid = {$userid}");
}
// check if successful
if (!$result) {
$this->addError("An error occured attempting update user info. " . $dbManager->getLastError());
return GlobalConstants::USER_INPUT;
}
$this->addNotice("Successfully updated user info for \"" . $this->email . "\".");
// get new user object
$result = mysql_query("SELECT * FROM users WHERE userid = {$userid}");
$user = mysql_fetch_object($result, 'User');
// update user object in session
$_SESSION[ValidateCredentials::USER_KEY] = $user;
// return success regardless since returned to the same place and error displayed
return GlobalConstants::SUCCESS;
}
开发者ID:Rkandel23,项目名称:ubar,代码行数:31,代码来源:UpdateAccount.php
示例2: executeInner
public function executeInner()
{
// instantiate db
$dbManager = new DBManager();
// make comments safe and nicely formatted
// TODO: strip tags with exceptions (see examples at http://us2.php.net/manual/en/function.strip-tags.php)
// allowable tags <b><strong><u><i><a><em> possibly allowable <ul><ol><li>
// TODO: convert "safe" tags to safe implementations, ex <strong style="foo"></strong> becomes <strong></strong>
// TODO: sanitize anchor tags, ex <a href="javascript://"> is killed and <a href="foo"> becomes <a href="foo" target="_blank">
// escape strings for insert
$name = $dbManager->escapeString($this->name);
$contents = $dbManager->escapeString($this->contents);
// do query
$result = mysql_query("INSERT INTO blogcomments SET blogid=" . $this->blogId . ",name='{$name}', message='{$contents}'");
// check if successful
if ($result) {
$this->addNotice("Successfully posted a blog entry from \"" . $this->name . "\".");
// TODO: determine why trend micro firewall causing this to hang and why email not sending even when not hanging
//$this->notifyAdmins();
} else {
$this->addError("An error occured attempting to add a blog post. " . $dbManager->getLastError());
}
// return success regardless since returned to the same place and error displayed
return GlobalConstants::SUCCESS;
}
开发者ID:Rkandel23,项目名称:ubar,代码行数:25,代码来源:PostBlogComment.php
示例3: setConfig
public static function setConfig($mod, $name, $value)
{
$db = new DBManager();
$table = 'core_conf';
if (!Comman::isConfig($mod, $name)) {
return Comman::createConfig($mod, $name, $value);
}
return $db->updateSingleColumn($table, 'value', $value, "module='{$mod}' AND name='{$name}'");
}
开发者ID:janruls1,项目名称:WomensLine,代码行数:9,代码来源:comman.php
示例4: execSQL
function execSQL($sql_file_path)
{
$mysql_host = MYSQL_HOST;
$mysql_db = MYSQL_DB;
$mysql_login = MYSQL_LOGIN;
$mysql_password = MYSQL_PASSWORD;
App::import('Vendor', 'sqlclient', array('file' => 'DbManager.class.php'));
$dbcon = new DBManager($mysql_host, $mysql_login, $mysql_password, $mysql_db);
$sql_result = $dbcon->run_all($sql_file_path);
return $sql_result;
}
开发者ID:hobbysh,项目名称:seevia-frameworks,代码行数:11,代码来源:upgrades_controller.php
示例5: consultarid
function consultarid($id_expediente)
{
$con = new DBManager();
if ($con->conectar() == true) {
$query = "SELECT * FROM t_expediente WHERE id_expediente={$id_expediente}";
$result = @mysql_query($query);
if (!$result) {
return false;
} else {
return $result;
}
}
}
开发者ID:alexcarlosramirez,项目名称:upcdsd-viii-vuce,代码行数:13,代码来源:cEntidad.php
示例6: executeInner
protected function executeInner()
{
// instantiate db
$dbManager = new DBManager();
// do query
$result = mysql_query("DELETE FROM blogcomments WHERE commentid = " . $this->commentId);
// check if successful
if ($result) {
$this->addNotice("blog.notice.commentDeleted", array("id" => $this->commentId));
} else {
$this->addError("blog.error.failedCommentDeletion", array("id" => $this->commentId, "error" => $dbManager->getLastError()));
}
// return success regardless since returned to the same place and error displayed
return GlobalConstants::SUCCESS;
}
开发者ID:Rkandel23,项目名称:ubar,代码行数:15,代码来源:DeleteBlogComment.php
示例7: __construct
function __construct($ro = true)
{
$dbManager = new DBManager();
$this->link = $dbManager->getDataBaseLink($ro);
// readonly
if (!$this->link) {
error_log('Error connecting to database: ' . mysql_error());
die('Error connecting to database');
}
if (!$dbManager->selectOzoneDB($this->link)) {
error_log('Error selecting ozone database: ' . mysql_error());
die('Error selecting ozone database');
}
$this->dbManager = $dbManager;
}
开发者ID:DataAnalyticsinStudentHands,项目名称:OldOzoneMap,代码行数:15,代码来源:QueryManager.php
示例8: Ilias4ConnectedUser
/**
* constructor
*
* init class.
* @access
* @param string $cms system-type
*/
function Ilias4ConnectedUser($cms, $user_id = false)
{
// get auth_plugin
$user_id = $user_id ? $user_id : $GLOBALS['user']->id;
$this->auth_plugin = DBManager::get()->query("SELECT IFNULL(auth_plugin, 'standard') FROM auth_user_md5 WHERE user_id = '" . $user_id . "'")->fetchColumn();
parent::Ilias3ConnectedUser($cms, $user_id);
}
开发者ID:ratbird,项目名称:hope,代码行数:14,代码来源:Ilias4ConnectedUser.class.php
示例9: get_booked_rooms_action
function get_booked_rooms_action($api_key, $start_timestamp, $end_timestamp)
{
$ret = array();
if (!$start_timestamp) {
$start_timestamp = strtotime('today');
}
if (!$end_timestamp) {
$end_timestamp = strtotime("+2 weeks", $start_timestamp);
}
$db = DBManager::get();
$rs = $db->query(sprintf("\n SELECT begin, end, s.Name AS lecture_title, s.Beschreibung, i.Name AS lecture_home_institute, r.resource_id, r.name AS room, GROUP_CONCAT( CONCAT_WS( '|', auth_user_md5.Vorname, auth_user_md5.Nachname, user_info.title_front, user_info.title_rear )\n ORDER BY seminar_user.position\n SEPARATOR ';' ) AS lecturer_name\n FROM resources_assign ra\n INNER JOIN resources_objects r ON ra.resource_id = r.resource_id\n INNER JOIN termine t ON termin_id = assign_user_id\n INNER JOIN seminare s ON range_id = Seminar_id\n INNER JOIN Institute i ON i.Institut_id = s.Institut_id\n LEFT JOIN seminar_user ON s.seminar_id = seminar_user.seminar_id\n AND seminar_user.status = 'dozent'\n LEFT JOIN auth_user_md5 ON seminar_user.user_id = auth_user_md5.user_id\n LEFT JOIN user_info ON user_info.user_id = auth_user_md5.user_id\n WHERE begin\n BETWEEN %s\n AND %s\n GROUP BY assign_id", $db->quote($start_timestamp), $db->quote($end_timestamp)));
while ($row = $rs->fetch(PDO::FETCH_ASSOC)) {
$lecturers = explode(';', $row['lecturer_name']);
list($vorname, $nachname, $titel1, $titel2) = explode('|', $lecturers[0]);
$room = new Studip_Booked_Room();
$room->start_time = $row['begin'];
$room->end_time = $row['end'];
$room->room = $row['room'];
$room->room_id = $row['resource_id'];
$room->lecture_title = $row['lecture_title'];
$room->lecture_home_institute = $row['lecture_home_institute'];
$room->lecture_description = $row['Beschreibung'];
$room->lecturer_title_front = $titel1;
$room->lecturer_title_rear = $titel2;
$room->lecturer_name = $vorname . ' ' . $nachname;
$ret[] = $room;
}
return $ret;
}
开发者ID:noackorama,项目名称:source-talk-2012,代码行数:29,代码来源:booked_rooms_webservice.php
示例10: increatePrioritiesByUserId
/**
*
*/
public static function increatePrioritiesByUserId($user_id)
{
$query = "UPDATE kategorien SET priority = priority + 1 WHERE range_id = ?";
$statement = DBManager::get()->prepare($query);
$statement->execute(array($user_id));
return $statement->rowCount() > 0;
}
开发者ID:ratbird,项目名称:hope,代码行数:10,代码来源:Kategorie.class.php
示例11: checkLine
public function checkLine($line)
{
$errors = "";
if (!FleximportTable::findOneByName("fleximport_semiro_course_import")) {
return "Tabelle fleximport_semiro_course_import existiert nicht. ";
}
$dilp_kennung_feld = FleximportConfig::get("SEMIRO_DILP_KENNUNG_FIELD");
if (!$dilp_kennung_feld) {
$dilp_kennung_feld = "dilp_teilnehmer";
}
if (!$line[$dilp_kennung_feld]) {
$errors .= "Teilnehmer hat keinen Wert für '{$dilp_kennung_feld}''. ";
} else {
$datafield = Datafield::findOneByName(FleximportConfig::get("SEMIRO_USER_DATAFIELD_NAME"));
if (!$datafield) {
$errors .= "System hat kein Datenfeld " . FleximportConfig::get("SEMIRO_USER_DATAFIELD_NAME") . ", womit die Nutzer identifiziert werden. ";
} else {
$entry = DatafieldEntryModel::findOneBySQL("datafield_id = ? AND content = ? ", array($datafield->getId(), $line[$dilp_kennung_feld]));
if (!$entry || !User::find($entry['range_id'])) {
$errors .= "Nutzer konnte nicht durch id_teilnehmer identifiziert werden. ";
}
}
}
if (!$line['teilnehmergruppe']) {
$errors .= "Keine Teilnehmergruppe. ";
} else {
$statement = DBManager::get()->prepare("\n SELECT 1\n FROM fleximport_semiro_course_import\n WHERE teilnehmergruppe = ?\n ");
$statement->execute(array($line['teilnehmergruppe']));
if (!$statement->fetch()) {
$errors .= "Nicht verwendete Teilnehmergruppe. ";
}
}
return $errors;
}
开发者ID:Krassmus,项目名称:Fleximport,代码行数:34,代码来源:fleximport_semiro_participant_import.php
示例12: initItem
public function initItem()
{
global $user, $neux;
parent::initItem();
$my_messaging_settings = UserConfig::get($user->id)->MESSAGING_SETTINGS;
$lastVisitedTimestamp = isset($my_messaging_settings['last_box_visit']) ? (int) $my_messaging_settings['last_box_visit'] : 0;
$query = "SELECT SUM(mkdate > :time AND readed = 0) AS num_new,\n SUM(readed = 0) AS num_unread,\n SUM(readed = 1) AS num_read\n FROM message_user\n WHERE snd_rec = 'rec' AND user_id = :user_id AND deleted = 0";
$statement = DBManager::get()->prepare($query);
$statement->bindValue(':time', $lastVisitedTimestamp);
$statement->bindValue(':user_id', $GLOBALS['user']->id);
$statement->execute();
list($neux, $neum, $altm) = $statement->fetch(PDO::FETCH_NUM);
$this->setBadgeNumber($neum);
if ($neux > 0) {
$tip = sprintf(ngettext('Sie haben %d neue ungelesene Nachricht', 'Sie haben %d neue ungelesene Nachrichten', $neux), $neux);
} else {
if ($neum > 1) {
$tip = sprintf(ngettext('Sie haben %d ungelesene Nachricht', 'Sie haben %d ungelesene Nachrichten', $neum), $neum);
} else {
if ($altm > 1) {
$tip = sprintf(ngettext('Sie haben %d alte empfangene Nachricht', 'Sie haben %d alte empfangene Nachrichten', $altm), $altm);
} else {
$tip = _('Sie haben keine alten empfangenen Nachrichten');
}
}
}
$this->setImage(Icon::create('mail', 'navigation', ["title" => $tip]));
}
开发者ID:ratbird,项目名称:hope,代码行数:28,代码来源:MessagingNavigation.php
示例13: get_local_tree
function get_local_tree($sem_tree_id)
{
$db = DBManager::get();
$stmt = $db->prepare('SELECT sem_tree_id FROM sem_tree WHERE parent_id = ? ORDER BY priority');
$stmt->execute(array($sem_tree_id));
return $stmt->fetchAll(PDO::FETCH_COLUMN);
}
开发者ID:ratbird,项目名称:hope,代码行数:7,代码来源:studip_lecture_tree.php
示例14: initItem
public function initItem()
{
parent::initItem();
if (is_object($GLOBALS['user']) && $GLOBALS['user']->id != 'nobody') {
if (WidgetHelper::hasWidget($GLOBALS['user']->id, 'News')) {
$news = StudipNews::CountUnread();
}
if (Config::get()->VOTE_ENABLE && WidgetHelper::hasWidget($GLOBALS['user']->id, 'Evaluations')) {
$threshold = Config::get()->NEW_INDICATOR_THRESHOLD ? strtotime("-{" . Config::get()->NEW_INDICATOR_THRESHOLD . "} days 0:00:00") : 0;
$statement = DBManager::get()->prepare("\n SELECT COUNT(*)\n FROM questionnaire_assignments\n INNER JOIN questionnaires ON (questionnaires.questionnaire_id = questionnaire_assignments.questionnaire_id)\n WHERE questionnaire_assignments.range_id = 'start'\n AND questionnaires.visible = 1\n AND questionnaires.startdate IS NOT NULL\n AND questionnaires.startdate > UNIX_TIMESTAMP()\n AND questionnaires.startdate > :threshold\n AND (questionnaires.stopdate IS NULL OR questionnaires.stopdate <= UNIX_TIMESTAMP())\n ");
$statement->execute(array('threshold' => $threshold));
$vote = (int) $statement->fetchColumn();
$query = "SELECT COUNT(IF(chdate > IFNULL(b.visitdate, :threshold) AND d.author_id != :user_id, a.eval_id, NULL))\n FROM eval_range a\n INNER JOIN eval d ON (a.eval_id = d.eval_id AND d.startdate < UNIX_TIMESTAMP() AND\n (d.stopdate > UNIX_TIMESTAMP() OR d.startdate + d.timespan > UNIX_TIMESTAMP() OR (d.stopdate IS NULL AND d.timespan IS NULL)))\n LEFT JOIN object_user_visits b ON (b.object_id = d.eval_id AND b.user_id = :user_id AND b.type = 'eval')\n WHERE a.range_id = 'studip'\n GROUP BY a.range_id";
$statement = DBManager::get()->prepare($query);
$statement->bindValue(':user_id', $GLOBALS['user']->id);
$statement->bindValue(':threshold', ($threshold = Config::get()->NEW_INDICATOR_THRESHOLD) ? strtotime("-{$threshold} days 0:00:00") : 0);
$statement->execute();
$vote += (int) $statement->fetchColumn();
}
}
$homeinfo = _('Zur Startseite');
if ($news) {
$homeinfo .= ' - ';
$homeinfo .= sprintf(ngettext('%u neue Ankündigung', '%u neue Ankündigungen', $news), $news);
}
if ($vote) {
$homeinfo .= ' - ';
$homeinfo .= sprintf(ngettext('%u neuer Fragebogen', '%u neue Fragebögen', $vote), $vote);
}
$this->setBadgeNumber($vote + $news);
$this->setImage(Icon::create('home', 'navigation', ["title" => $homeinfo]));
}
开发者ID:ratbird,项目名称:hope,代码行数:32,代码来源:StartNavigation.php
示例15: renderTableGestion
public function renderTableGestion()
{
$this->man = DBManager::getInstance();
//crea instancia
$this->man->connect();
//conectate a la bbdd
}
开发者ID:nemoNoboru,项目名称:ET3,代码行数:7,代码来源:renderTableGestion.php
示例16: up
function up()
{
$sql = "CREATE TABLE IF NOT EXISTS `user_visibility_settings` (\n `user_id` varchar(32) NOT NULL DEFAULT '',\n `visibilityid` int(11) NOT NULL AUTO_INCREMENT,\n `parent_id` int(11) NOT NULL,\n `category` int(2) NOT NULL,\n `name` varchar(128) NOT NULL,\n `state` int(2) NULL,\n `plugin` int(11),\n `identifier` varchar(64) NOT NULL,\n PRIMARY KEY (`visibilityid`),\n KEY `parent_id` (`parent_id`),\n KEY `identifier` (`identifier`),\n KEY `userid` (`user_id`)\n) ENGINE=MyISAM";
$db = DBManager::get();
$stmt = $db->prepare($sql);
$stmt->execute();
$category = array('Studien-/Einrichtungsdaten' => 'studdata', 'Private Daten' => 'privatedata', 'Zusätzliche Datenfelder' => 'additionaldata', 'Eigene Kategorien' => 'owncategory', 'Allgemeine Daten' => 'commondata');
$result = $db->query("SELECT value FROM config WHERE field = 'HOMEPAGE_VISIBILITY_DEFAULT' ORDER BY is_default LIMIT 1");
$default_visibility = constant($result->fetchColumn());
$sql = "SELECT `username` FROM `auth_user_md5`";
$stmt = $db->prepare($sql);
$stmt->execute();
while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
$about = new about($result['username'], '');
Visibility::createDefaultCategories($about->auth_user['user_id']);
//copy all homepage visibility
$elements = $about->get_homepage_elements();
if (is_array($elements)) {
foreach ($elements as $key => $state) {
if ($state['visibility'] != $default_visibility) {
Visibility::addPrivacySetting($state['name'], $key, $category[$state['category']], 1, $about->auth_user['user_id'], $state['visibility']);
}
}
}
}
}
开发者ID:ratbird,项目名称:hope,代码行数:26,代码来源:108_visibilityapi.php
示例17: down
function down()
{
$db = DBManager::get();
$db->exec("DROP TABLE `seminar_cycle_dates`");
$db->exec("ALTER TABLE `seminare` ADD `metadata_dates` TEXT NOT NULL DEFAULT ''");
$db->exec("DELETE FROM config WHERE field LIKE 'ALLOW_METADATE_SORTING'");
}
开发者ID:ratbird,项目名称:hope,代码行数:7,代码来源:69_step_00202_enhanced_seminar_cycle.php
示例18: global_action
/**
* Stores the privacy settings concerning the appearance of a user inside
* the system.
*/
public function global_action()
{
$this->check_ticket();
$visibility = Request::option('global_visibility');
// Globally visible or unknown -> set local visibilities accordingly.
if ($visibility != 'no') {
$online = Request::int('online') ?: 0;
$search = Request::int('search') ?: 0;
$email = Request::int('email') ?: 0;
$foaf_show_identity = Request::int('foaf_show_identity') ?: 0;
// Globally invisible -> set all local fields to invisible.
} else {
$online = $search = $foaf_show_identity = 0;
$email = get_config('DOZENT_ALLOW_HIDE_EMAIL') ? 0 : 1;
$success = $this->about->change_all_homepage_visibility(VISIBILITY_ME);
}
$this->config->store('FOAF_SHOW_IDENTITY', $foaf_show_identity);
$this->user->visible = $visibility;
$this->user->store();
$query = "INSERT INTO user_visibility\n (user_id, online, search, email, mkdate)\n VALUES (?, ?, ?, ?, UNIX_TIMESTAMP())\n ON DUPLICATE KEY\n UPDATE online = VALUES(online),\n search = VALUES(search), email = VALUES(email)";
$statement = DBManager::get()->prepare($query);
$statement->execute(array($this->user->user_id, $online, $search, $email));
$this->reportSuccess(_('Ihre Sichtbarkeitseinstellungen wurden gespeichert.'));
$this->redirect('settings/privacy');
}
开发者ID:ratbird,项目名称:hope,代码行数:29,代码来源:privacy.php
示例19: afterStoreCallback
public function afterStoreCallback()
{
if ($this->isDirty()) {
//add notification to writer of review
if (!$this->review['host_id'] && $this->review['user_id'] !== $this['user_id']) {
PersonalNotifications::add($this->review['user_id'], URLHelper::getURL("plugins.php/lernmarktplatz/market/discussion/" . $this['review_id'] . "#comment_" . $this->getId()), sprintf(_("%s hat einen Kommentar zu Ihrem Review geschrieben."), $this['host_id'] ? LernmarktplatzUser::find($this['user_id'])->name : get_fullname($this['user_id'])), "comment_" . $this->getId(), Icon::create("support", "clickable"));
}
//add notification to all users of this servers who discussed this review but are neither the new
//commentor nor the writer of the review
$statement = DBManager::get()->prepare("\n SELECT user_id\n FROM lernmarktplatz_comments\n WHERE review_id = :review_id\n AND host_id IS NULL\n GROUP BY user_id\n ");
$statement->execute(array('review_id' => $this->review->getId()));
foreach ($statement->fetchAll(PDO::FETCH_COLUMN, 0) as $user_id) {
if (!in_array($user_id, array($this->review['user_id'], $this['user_id']))) {
PersonalNotifications::add($user_id, URLHelper::getURL("plugins.php/lernmarktplatz/market/discussion/" . $this['review_id'] . "#comment_" . $this->getId()), sprintf(_("%s hat auch einen Kommentar geschrieben."), $this['host_id'] ? LernmarktplatzUser::find($this['user_id'])->name : get_fullname($this['user_id'])), "comment_" . $this->getId(), Icon::create("support", "clickable"));
}
}
//only push if the comment is from this server and the material-server is different
if (!$this['host_id']) {
$myHost = LernmarktplatzHost::thisOne();
$data = array();
$data['host'] = array('name' => $myHost['name'], 'url' => $myHost['url'], 'public_key' => $myHost['public_key']);
$data['data'] = $this->toArray();
$data['data']['foreign_comment_id'] = $data['data']['comment_id'];
unset($data['data']['comment_id']);
unset($data['data']['id']);
unset($data['data']['user_id']);
unset($data['data']['host_id']);
$user_description_datafield = DataField::find(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")) ?: DataField::findOneBySQL("name = ?", array(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")));
if ($user_description_datafield) {
$datafield_entry = DatafieldEntryModel::findOneBySQL("range_id = ? AND datafield_id = ?", array($this['user_id'], $user_description_datafield->getId()));
}
$data['user'] = array('user_id' => $this['user_id'], 'name' => get_fullname($this['user_id']), 'avatar' => Avatar::getAvatar($this['user_id'])->getURL(Avatar::NORMAL), 'description' => $datafield_entry ? $datafield_entry['content'] : null);
$statement = DBManager::get()->prepare("\n SELECT host_id\n FROM lernmarktplatz_comments\n WHERE review_id = :review_id\n AND host_id IS NOT NULL\n GROUP BY host_id\n ");
$statement->execute(array('review_id' => $this->review->getId()));
$hosts = $statement->fetchAll(PDO::FETCH_COLUMN, 0);
if ($this->review['host_id'] && !in_array($this->review['host_id'], $hosts)) {
$hosts[] = $this->review['host_id'];
}
if ($this->review->material['host_id'] && !in_array($this->review->material['host_id'], $hosts)) {
$hosts[] = $this->review->material['host_id'];
}
foreach ($hosts as $host_id) {
$remote = new LernmarktplatzHost($host_id);
if (!$remote->isMe()) {
$review_id = $this->review['foreign_review_id'] ?: $this->review->getId();
if ($this->review['foreign_review_id']) {
if ($this->review->host_id === $remote->getId()) {
$host_hash = null;
} else {
$host_hash = md5($this->review->host['public_key']);
}
} else {
$host_hash = md5($myHost['public_key']);
}
$remote->pushDataToEndpoint("add_comment/" . $review_id . "/" . $host_hash, $data);
}
}
}
}
}
开发者ID:Krassmus,项目名称:LehrMarktplatz,代码行数:60,代码来源:LernmarktplatzComment.php
示例20: up
function up()
{
$db = DBManager::get();
$db->exec("\n ALTER TABLE `px_topics` ADD `external_contact` TINYINT NOT NULL DEFAULT '0' AFTER `user_id` \n ");
$db->exec("\n ALTER TABLE `blubber_mentions` ADD `external_contact` TINYINT NOT NULL DEFAULT '0' AFTER `user_id` \n ");
$db->exec("\n CREATE TABLE IF NOT EXISTS `blubber_external_contact` (\n `external_contact_id` varchar(32) NOT NULL,\n `mail_identifier` varchar(256) DEFAULT NULL,\n `contact_type` varchar(16) NOT NULL DEFAULT 'anonymous',\n `name` varchar(256) NOT NULL,\n `data` TEXT NULL,\n `chdate` bigint(20) NOT NULL,\n `mkdate` bigint(20) NOT NULL,\n PRIMARY KEY (`external_contact_id`)\n ) ENGINE=MyISAM\n ");
}
开发者ID:noackorama,项目名称:blubberforum,代码行数:7,代码来源:04_external_contacts_migration.php
注:本文中的DBManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论