当前位置: 首页>>代码示例>>PHP>>正文


PHP DBUtils::getSequenceValue方法代码示例

本文整理汇总了PHP中DBUtils::getSequenceValue方法的典型用法代码示例。如果您正苦于以下问题:PHP DBUtils::getSequenceValue方法的具体用法?PHP DBUtils::getSequenceValue怎么用?PHP DBUtils::getSequenceValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DBUtils的用法示例。


在下文中一共展示了DBUtils::getSequenceValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: insert

 function insert()
 {
     global $DB_LINK, $LangUI, $db_table_restaurants, $g_rb_restaurant_id_seq;
     $sql = "INSERT INTO {$db_table_restaurants} (\n\t\t\t\trestaurant_name,\n\t\t\t\trestaurant_website,\n\t\t\t\trestaurant_address,\n\t\t\t\trestaurant_city,\n\t\t\t\trestaurant_state,\n\t\t\t\trestaurant_zip,\n\t\t\t\trestaurant_country,\n\t\t\t\trestaurant_phone,\n\t\t\t\trestaurant_hours,\n\t\t\t\trestaurant_menu_text,\n\t\t\t\trestaurant_comments,\n\t\t\t\trestaurant_price,\n\t\t\t\trestaurant_delivery,\n\t\t\t\trestaurant_carry_out,\n\t\t\t\trestaurant_dine_in,\n\t\t\t\trestaurant_credit,\n\t\t\t\trestaurant_user) VALUES (\n\t\t\t\t'" . $DB_LINK->addq($this->name, get_magic_quotes_gpc()) . "',\n\t\t\t\t'" . $DB_LINK->addq($this->website, get_magic_quotes_gpc()) . "',\n\t\t\t\t'" . $DB_LINK->addq($this->address, get_magic_quotes_gpc()) . "',\n\t\t\t\t'" . $DB_LINK->addq($this->city, get_magic_quotes_gpc()) . "',\n\t\t\t\t'" . $DB_LINK->addq($this->state, get_magic_quotes_gpc()) . "',\n\t\t\t\t'" . $DB_LINK->addq($this->zip, get_magic_quotes_gpc()) . "',\n\t\t\t\t'" . $DB_LINK->addq($this->country, get_magic_quotes_gpc()) . "',\n\t\t\t\t'" . $DB_LINK->addq($this->phone, get_magic_quotes_gpc()) . "',\n\t\t\t\t'" . $DB_LINK->addq($this->hours, get_magic_quotes_gpc()) . "',\n\t\t\t\t'" . $DB_LINK->addq($this->menu_text, get_magic_quotes_gpc()) . "',\n\t\t\t\t'" . $DB_LINK->addq($this->comments, get_magic_quotes_gpc()) . "',\n\t\t\t\t" . $DB_LINK->addq($this->price, get_magic_quotes_gpc()) . ",\n\t\t\t\t'" . $DB_LINK->addq($this->delivery, get_magic_quotes_gpc()) . "',\n\t\t\t\t'" . $DB_LINK->addq($this->carry_out, get_magic_quotes_gpc()) . "',\n\t\t\t\t'" . $DB_LINK->addq($this->dine_in, get_magic_quotes_gpc()) . "',\n\t\t\t\t'" . $DB_LINK->addq($this->credit, get_magic_quotes_gpc()) . "',\n\t\t\t\t'" . $DB_LINK->addq($this->owner, get_magic_quotes_gpc()) . "')";
     $rc = $DB_LINK->Execute($sql);
     DBUtils::checkResult($rc, NULL, $LangUI->_('There was an error inserting the restaurant'), $sql);
     $this->id = DBUtils::getSequenceValue($g_rb_restaurant_id_seq);
     return $this->id;
 }
开发者ID:pjflameboy,项目名称:phprecipebook,代码行数:9,代码来源:Restaurant.class.php

示例2: insert

 /**
 	Inserts a new ingredient into the database
 */
 function insert()
 {
     global $db_table_ingredients, $DB_LINK, $g_rb_ingredient_id_seq, $LangUI;
     $sql = "INSERT INTO {$db_table_ingredients}\n\t\t\t\t\t\t\t(ingredient_core,\n\t\t\t\t\t\t\t ingredient_name,\n\t\t\t\t\t\t\t ingredient_desc,\n\t\t\t\t\t\t\t ingredient_unit,\n\t\t\t\t\t\t\t ingredient_location,\n\t\t\t\t\t\t\t ingredient_solid,\n\t\t\t\t\t\t\t ingredient_system,\n\t\t\t\t\t\t\t ingredient_user)\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t\t('" . $DB_LINK->addq($this->core_id, get_magic_quotes_gpc()) . "',\n\t\t\t\t\t\t\t'" . $DB_LINK->addq($this->name, get_magic_quotes_gpc()) . "',\n\t\t\t\t\t\t\t'" . $DB_LINK->addq($this->description, get_magic_quotes_gpc()) . "',\n\t\t\t\t\t\t\t" . $DB_LINK->addq($this->unit, get_magic_quotes_gpc()) . ",\n\t\t\t\t\t\t\t" . $DB_LINK->addq($this->location, get_magic_quotes_gpc()) . ",\n\t\t\t\t\t\t\t'" . $DB_LINK->addq($this->solid, get_magic_quotes_gpc()) . "',\n\t\t\t\t\t\t\t'" . $DB_LINK->addq($this->system, get_magic_quotes_gpc()) . "',\n\t\t\t\t\t\t\t'" . $DB_LINK->addq($this->user, get_magic_quotes_gpc()) . "')";
     // Insert the new ingredient into the database
     $rc = $DB_LINK->Execute($sql);
     DBUtils::checkResult($rc, $LangUI->_('Ingredient Added') . ": " . $this->name, $LangUI->_('There was an error adding the ingredient'), $sql);
     // retrieve incremented sequence value (PostgreSQL)
     $id = DBUtils::getSequenceValue($g_rb_ingredient_id_seq);
     return $id;
 }
开发者ID:pjflameboy,项目名称:phprecipebook,代码行数:14,代码来源:Ingredient.class.php

示例3: insert

 /**
 	Insert a new Recipe into the database
 */
 function insert()
 {
     global $db_table_recipes, $DB_LINK, $g_rb_recipe_id_seq, $LangUI;
     // do the Insert
     $sql = "INSERT INTO {$db_table_recipes}\n\t\t\t\t\t\t(recipe_name,\n\t\t\t\t\t\t recipe_ethnic,\n\t\t\t\t\t\t recipe_base,\n\t\t\t\t\t\t recipe_course,\n\t\t\t\t\t\t recipe_prep_time,\n\t\t\t\t\t\t recipe_difficulty,\n\t\t\t\t\t\t recipe_directions,\n\t\t\t\t\t\t recipe_comments,\n\t\t\t\t\t\t recipe_serving_size,\n\t\t\t\t\t\t recipe_source,\n\t\t\t\t\t\t recipe_source_desc,\n\t\t\t\t\t\t recipe_modified,\n\t\t\t\t\t\t recipe_system,\n\t\t\t\t\t\t recipe_private,\n\t\t\t\t\t\t recipe_user)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t('" . $DB_LINK->addq($this->name, get_magic_quotes_gpc()) . "',\n\t\t\t\t\t\t " . $DB_LINK->addq($this->ethnic, get_magic_quotes_gpc()) . ",\n\t\t\t\t\t\t " . $DB_LINK->addq($this->base, get_magic_quotes_gpc()) . ",\n\t\t\t\t\t\t " . $DB_LINK->addq($this->course, get_magic_quotes_gpc()) . ",\n\t\t\t\t\t\t " . $DB_LINK->addq($this->prep_time, get_magic_quotes_gpc()) . ",\n\t\t\t\t\t\t " . $DB_LINK->addq($this->difficulty, get_magic_quotes_gpc()) . ",\n\t\t\t\t\t\t '" . $DB_LINK->addq($this->directions, get_magic_quotes_gpc()) . "',\n\t\t\t\t\t\t '" . $DB_LINK->addq($this->comments, get_magic_quotes_gpc()) . "',\n\t\t\t\t\t\t " . $DB_LINK->addq($this->serving_size, get_magic_quotes_gpc()) . ",\n\t\t\t\t\t\t " . $DB_LINK->addq($this->source, get_magic_quotes_gpc()) . ",\n\t\t\t\t\t\t '" . $DB_LINK->addq($this->source_desc, get_magic_quotes_gpc()) . "',\n\t\t\t\t\t\t {$this->modified},\n\t\t\t\t\t\t '" . $DB_LINK->addq($this->unitSystem, get_magic_quotes_gpc()) . "',\n\t\t\t\t\t\t '" . $DB_LINK->addq($this->private, get_magic_quotes_gpc()) . "',\n\t\t\t\t\t\t '" . $DB_LINK->addq($this->user, get_magic_quotes_gpc()) . "')";
     $rc = $DB_LINK->Execute($sql);
     DBUtils::checkResult($rc, $LangUI->_('Recipe Successfully created') . ": " . $this->name, $LangUI->_('There was an error inserting the recipe'), $sql);
     // retrieve incremented sequence value
     $this->id = DBUtils::getSequenceValue($g_rb_recipe_id_seq);
     return $this->id;
 }
开发者ID:pjflameboy,项目名称:phprecipebook,代码行数:14,代码来源:Recipe.class.php

示例4: saveNewList

 /**
 	Save a new shopping list
 */
 function saveNewList($name)
 {
     global $DB_LINK, $db_table_list_recipe, $db_table_list_ingredients, $db_table_list_names, $g_rb_list_id_seq, $SMObj;
     $this->name = $name;
     $name = $DB_LINK->addq($name, get_magic_quotes_gpc());
     $sql = "INSERT INTO {$db_table_list_names} (\n\t\t\t\t\t\tlist_name,\n\t\t\t\t\t\tlist_user)\n\t\t\t\t\tVALUES ('{$name}','" . $SMObj->getUserID() . "')";
     $rc = $DB_LINK->Execute($sql);
     DBUtils::checkResult($rc, NULL, NULL, $sql);
     $this->id = DBUtils::getSequenceValue($g_rb_list_id_seq);
     $this->saveAllItems();
 }
开发者ID:pjflameboy,项目名称:phprecipebook,代码行数:14,代码来源:ShoppingList.class.php


注:本文中的DBUtils::getSequenceValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。