本文整理汇总了PHP中tep_db_insert_id函数的典型用法代码示例。如果您正苦于以下问题:PHP tep_db_insert_id函数的具体用法?PHP tep_db_insert_id怎么用?PHP tep_db_insert_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tep_db_insert_id函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: newUpload
function newUpload($jng_sp_id, $type, $filename, $upload_by)
{
$upload_data = array('jng_sp_id' => $jng_sp_id, 'type' => $type, 'filename' => $filename, 'upload_time' => date('Y-m-d H:i:s'), 'upload_by' => $upload_by);
tep_db_perform('jng_sp_upload', $upload_data);
$upload_id = tep_db_insert_id();
return $upload_id;
}
示例2: affiliate_insert
function affiliate_insert($sql_data_array, $affiliate_parent = 0)
{
// LOCK TABLES
tep_db_query("LOCK TABLES " . TABLE_AFFILIATE . " WRITE");
if ($affiliate_parent > 0) {
$affiliate_root_query = tep_db_query("select affiliate_root, affiliate_rgt, affiliate_lft�from " . TABLE_AFFILIATE . " where affiliate_id = '" . $affiliate_parent . "' ");
// Check if we have a parent affiliate
if ($affiliate_root_array = tep_db_fetch_array($affiliate_root_query)) {
tep_db_query("update " . TABLE_AFFILIATE . " SET affiliate_lft = affiliate_lft + 2 WHERE affiliate_root = '" . $affiliate_root_array['affiliate_root'] . "' and affiliate_lft > " . $affiliate_root_array['affiliate_rgt'] . " AND affiliate_rgt >= " . $affiliate_root_array['affiliate_rgt'] . " ");
tep_db_query("update " . TABLE_AFFILIATE . " SET affiliate_rgt = affiliate_rgt + 2 WHERE affiliate_root = '" . $affiliate_root_array['affiliate_root'] . "' and affiliate_rgt >= " . $affiliate_root_array['affiliate_rgt'] . " ");
$sql_data_array['affiliate_root'] = $affiliate_root_array['affiliate_root'];
$sql_data_array['affiliate_lft'] = $affiliate_root_array['affiliate_rgt'];
$sql_data_array['affiliate_rgt'] = $affiliate_root_array['affiliate_rgt'] + 1;
tep_db_perform(TABLE_AFFILIATE, $sql_data_array);
$affiliate_id = tep_db_insert_id();
}
// no parent -> new root
} else {
$sql_data_array['affiliate_lft'] = '1';
$sql_data_array['affiliate_rgt'] = '2';
tep_db_perform(TABLE_AFFILIATE, $sql_data_array);
$affiliate_id = tep_db_insert_id();
tep_db_query("update " . TABLE_AFFILIATE . " set affiliate_root = '" . $affiliate_id . "' where affiliate_id = '" . $affiliate_id . "' ");
}
// UNLOCK TABLES
tep_db_query("UNLOCK TABLES");
return $affiliate_id;
}
示例3: add
function add($products_id, $type, $links_id, $prepared = false)
{
if (is_array($links_id) && count($links_id) > 0) {
if (!$prepared) {
$products_id = tep_db_prepare_input($products_id);
$type = tep_db_prepare_input($type);
}
$plids = array();
foreach ($links_id as $lid) {
if (!$prepared) {
$lid = tep_db_prepare_input($lid);
}
if (intval($lid) != 0 && $products_id != $lid) {
//$check_exist = tep_db_query("SELECT products_linking_id FROM products_linking WHERE products_id=$products_id AND type='$type' AND links_id=$lid");
$check_exist = tep_db_query("SELECT products_linking_id FROM products_linking WHERE products_id={$products_id} AND links_id={$lid}");
if (tep_db_num_rows($check_exist) == 0) {
$sda = array();
$sda['products_id'] = $products_id;
$sda['type'] = $type;
$sda['links_id'] = $lid;
$sda['date_added'] = date('Y-m-d H:i:s');
tep_db_perform('products_linking', $sda);
$plids[] = tep_db_insert_id();
}
}
}
} else {
if ($links_id != '') {
$links = explode(',', $links_id);
$plids = $this->add($products_id, $type, $links, $prepared);
}
}
return $plids;
}
示例4: createNew
public function createNew($order_currency, $username)
{
/*
$sda = array();
$sda['elements_suppliers_id'] = $this->suppliers_id;
$sda['currency'] = $order_currency;
$sda['date_created'] = date('Y-m-d');
$sda['status'] = '0';
$sda['created_by'] = $username;
tep_db_perform('elements_orders', $sda);
*/
//USED THIS, SO PO NUMBER GENERATED WHEN INSERT, REDUCE SAME PO NUMBER USED BY TWO SUPPLIERS AT THE SAME TIME
$q = "INSERT INTO elements_orders";
$q .= " (";
$q .= " po_number";
$q .= ",elements_suppliers_id";
$q .= ",currency";
$q .= ",date_created";
$q .= ",status";
$q .= ",created_by";
$q .= " )";
$q .= " SELECT CONCAT(LPAD(MONTH(NOW()),2,0),'-',LPAD((IFNULL(MAX(SUBSTRING(po_number,4,3)*1)+1,1)), 3, '0')) po_number";
//po_number e.g: 01-001, 12-999 (MONTH-INCREMENT)
$q .= " ," . $this->suppliers_id;
$q .= " ,'{$order_currency}'";
$q .= " ,'" . date('Y-m-d') . "'";
$q .= " ,'0'";
$q .= " ,'{$username}'";
$q .= " FROM elements_orders WHERE date_created LIKE '" . date('Y-m') . "%'";
tep_db_query($q);
$this->orders_id = tep_db_insert_id();
$this->loadDetail();
}
示例5: store
/**
*
* @return
*/
function store()
{
$new_entry = true;
if (isset($this->fields['doba_log_id']) && $this->fields['doba_log_id'] > 0) {
$new_entry = false;
}
if ($new_entry) {
$sql = 'insert into DobaLog set ';
} else {
$sql = 'update DobaLog set ';
}
$cnt = 0;
foreach ($this->fields as $i => $f) {
if ($cnt > 0) {
$sql .= ',';
}
$sql .= $i . '="' . $f . '"';
++$cnt;
}
if (!$new_entry) {
$sql .= ' where doba_log_id=' . $this->fields['doba_log_id'];
}
if ($cnt > 0) {
$store = tep_db_query($sql);
$this->doba_log_id(tep_db_insert_id());
return true;
}
return false;
}
示例6: createNew
function createNew($package_code = '', $package_type = null)
{
$counter = 0;
if ($package_code == '') {
$counter++;
$prefix = !is_null($package_type) ? 'JG' : 'RET';
$dateprefix = date('ymd');
$package_code = $prefix . '-' . $dateprefix . '-' . $counter;
}
$check_code_exist = tep_db_query("SELECT packages_id FROM minierp_packages WHERE packages_code='{$package_code}'");
while (tep_db_num_rows($check_code_exist) > 0) {
if ($counter > 0) {
$old_counter = $dateprefix . '-' . $counter;
$counter++;
$new_counter = $dateprefix . '-' . $counter;
$package_code = str_replace($old_counter, $new_counter, $package_code);
} else {
$package_code .= '-New';
}
$check_code_exist = tep_db_query("SELECT packages_id FROM minierp_packages WHERE packages_code='{$package_code}'");
}
$psda = array();
//$psda['logistic_partners'] = 'SPN';
$psda['packages_code'] = $package_code;
if (!is_null($package_type)) {
$psda['package_type'] = $package_type;
}
tep_db_perform('minierp_packages', $psda);
$new_id = tep_db_insert_id();
return $new_id;
}
示例7: create
function create($name, $type, $code, $is_active, $pic, $address_street, $address_postcode, $address_city, $address_country_id)
{
$sql_data_array = array('name' => $name, 'warehouse_type' => $type, 'warehouse_code' => $code, 'is_active' => $is_active, 'pic' => $pic, 'address_street' => $address_street, 'address_postcode' => $address_postcode, 'address_city' => $address_city, 'address_country_id' => $address_country_id);
tep_db_perform('jng_warehouses', $sql_data_array);
$jng_warehouses_id = tep_db_insert_id();
return $jng_warehouses_id;
}
示例8: createNewCategoryTop
/**
* Create a new category top
* @param String $name Name of new category top
* @param Boolean $is_using_size True if category is using size instead of length
* @return Int ID of new category top or 0 if insert failed
*/
public static function createNewCategoryTop($name, $is_using_size)
{
$sda = array();
$sda[self::COLNAME_NAME] = $name;
$sda[self::COLNAME_SIZE] = $is_using_size ? '1' : '0';
tep_db_perform(self::TABLENAME, $sda);
return tep_db_insert_id();
}
示例9: add
function add($products_id, $price, $price_old, $options, $prepared = false)
{
if (!$prepared) {
$products_id = tep_db_prepare_input($products_id);
$price = tep_db_prepare_input($price);
foreach ($options as $key => $value) {
$options[$key] = tep_db_prepare_input($value);
}
}
//$get_vs = tep_db_query("SELECT virtual_stock FROM jng_sp_catalog WHERE jng_sp_catalog_id=$jng_sp_catalog_id");
//$vs = tep_db_fetch_array($get_vs);
/*
$sda = array( 'jng_sp_catalog_id'=>$jng_sp_catalog_id,
'sp_extra_id'=>'3',
'sp_extra_name'=>'Länge',
'sp_extra_value'=>$new_length,
'sp_extra_price'=>$new_length_price,
'virtual_stock'=>$vs['virtual_stock']
);
tep_db_perform('jng_sp_catalog_extra', $sda);
*/
//check if any existing options exist - start
$check_filter = " WHERE products_id={$products_id}";
foreach ($options as $key => $value) {
$check_filter .= " AND {$key}='{$value}'";
}
$check_query = tep_db_query("SELECT products_articles_id FROM products_articles {$check_filter}");
if (tep_db_num_rows($check_query) == 0) {
$update = true;
//check if same with default length
if (array_key_exists('length', $options)) {
$cq = "SELECT IFNULL(pc.products_length, pnc.products_length) AS products_length FROM products p";
$cq .= " LEFT JOIN products_configurator pc ON pc.products_id=p.products_id";
$cq .= " LEFT JOIN products_non_configurator pnc ON pnc.products_id=p.products_id";
$cq .= " WHERE p.products_id={$products_id}";
$cr = tep_db_query($cq);
$cd = tep_db_fetch_array($cr);
if ($cd['products_length'] == $options['length']) {
$update = false;
}
}
} else {
$update = false;
}
if ($update) {
$sda = array('products_id' => $products_id, 'price' => $price, 'price_old' => $price_old);
foreach ($options as $key => $value) {
$sda[$key] = $value;
}
tep_db_perform('products_articles', $sda);
$products_articles_id = tep_db_insert_id();
} else {
$products_articles_id = '0';
}
return $products_articles_id;
}
示例10: addExtraDesignImage
function addExtraDesignImage($design_id, $design_image, $createby)
{
$sda = array();
$sda['project_id'] = $design_id;
$sda['project_image'] = $design_image;
$sda['create_by'] = $createby;
$sda['create_date'] = date('Y-m-d H:i:s');
tep_db_perform('projectplan_images', $sda);
$newid = tep_db_insert_id();
return $newid;
}
示例11: create
function create($bundle_name, $bundle_desc)
{
$result = null;
$bundle_id = $this->id;
if (is_null($bundle_id)) {
$this->detail['bundle_name'] = $bundle_name;
$this->detail['bundle_desc'] = $bundle_desc;
tep_db_perform('products_bundle', $this->detail);
$this->id = tep_db_insert_id();
}
return $result;
}
示例12: addDownload
function addDownload($jng_sp_id, $type, $filename, $process_status, $download_by = 'auto-download', $info = '')
{
$dsda = array();
$dsda['jng_sp_id'] = $jng_sp_id;
$dsda['type'] = $type;
$dsda['filename'] = $filename;
$dsda['process_status'] = $process_status;
$dsda['download_time'] = date('Y-m-d H:i:s');
$dsda['download_by'] = $download_by;
$dsda['info'] = $info;
tep_db_perform('jng_sp_download', $dsda);
return tep_db_insert_id();
}
示例13: addNewDescription
function addNewDescription($design_id, $design_description, $updateby, $reminder)
{
$sdo = array();
$sdo['reminder'] = $reminder;
$result = tep_db_perform('projectplan_newdesign', $sdo, 'update', "project_id={$design_id}");
$sda = array();
$sda['project_id'] = $design_id;
$sda['project_description'] = $design_description;
$sda['last_update_by'] = $updateby;
$sda['last_update_time'] = date('Y-m-d H:i:s');
tep_db_perform('projectplan_description', $sda);
$newid = tep_db_insert_id();
return $newid;
}
示例14: install_ORP_to_sql
function install_ORP_to_sql($gid = 0)
{
$old_table_name = tep_db_fetch_array(tep_db_query("SHOW TABLES LIKE 'products_options_products'"));
if (tep_not_null($old_table_name)) {
tep_db_query("RENAME TABLE products_options_products TO products_related_products");
}
$insert_relationship_table = "CREATE TABLE IF NOT EXISTS `products_related_products` (\n `pop_id` int(11) NOT NULL auto_increment,\n `pop_products_id_master` int(11) NOT NULL default '0',\n `pop_products_id_slave` int(11) NOT NULL default '0',\n `pop_order_id` smallint(6) NOT NULL default '0',\n PRIMARY KEY (`pop_id`)\n ) CHARACTER SET utf8 COLLATE utf8_unicode_ci;";
tep_db_query($insert_relationship_table);
if (!$gid) {
tep_db_query("INSERT INTO `configuration_group` VALUES ( '', 'Related Products', 'Optional Related Products module', '999', '1' )");
$set_group_id = tep_db_insert_id();
} else {
$set_group_id = $gid;
}
tep_db_query("INSERT INTO `configuration`\n VALUES ('', 'Current Version', 'RELATED_PRODUCTS_VERSION_INSTALLED', '4.0', 'This key is used by the SQL install to automatically update your database during upgrades. It is read only.', " . $set_group_id . ", '0', NULL, now(), NULL , 'tep_version_readonly('),\n ('', 'Display Thumbnail Images', 'RELATED_PRODUCTS_SHOW_THUMBS', 'True', 'Show Product Image', " . $set_group_id . ", '1', NULL, now(), NULL , 'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Display Product Name', 'RELATED_PRODUCTS_SHOW_NAME', 'True', 'Show Product Name', " . $set_group_id . ", 2, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Display Product Model', 'RELATED_PRODUCTS_SHOW_MODEL', 'False', 'Show Product Model', " . $set_group_id . ", 3, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Display Price', 'RELATED_PRODUCTS_SHOW_PRICE', 'True', 'Show Product Price', " . $set_group_id . ", 4, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Display Quantity Available', 'RELATED_PRODUCTS_SHOW_QUANTITY', 'False', 'Show Product Quantity', " . $set_group_id . ", 5, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Display Buy Now Button', 'RELATED_PRODUCTS_SHOW_BUY_NOW', 'False', 'Show Buy Now Button', " . $set_group_id . ", 6, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Split Display Into Rows','RELATED_PRODUCTS_USE_ROWS','False','Set this option to True to display Related Products in multiple rows.'," . $set_group_id . ", 7,NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Define Number of Items Per Row','RELATED_PRODUCTS_PER_ROW','3','Maximum number of items to display per row when Split Display Into Rows is set to True.'," . $set_group_id . ", 8,NULL, now(),NULL,''),\n ('', 'Define Number of Items to Display', 'RELATED_PRODUCTS_MAX_DISP', '0', 'Maximum number of Related Products to display. 0 is unlimited.', " . $set_group_id . ", 9, NULL, now(),NULL,''),\n ('', 'Use Random Display Order', 'RELATED_PRODUCTS_RANDOMIZE', 'False', 'Adds random sort order to products displayed. Recommended if maximum number of products is set.', " . $set_group_id . ", 10, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Admin Display: Maximum Rows', 'RELATED_PRODUCTS_MAX_ROW_LISTS_OPTIONS', '10', 'Sets the maximum number of rows to display per page.', " . $set_group_id . ", 11, NULL, now(),NULL,''),\n ('', 'Admin Display: Drop-Down List Maximum Length', 'RELATED_PRODUCTS_MAX_NAME_LENGTH', '25', 'Sets the maximum length (in characters) of product name displayed in drop-down lists. Enter \\'0\\' to set this option to false.', " . $set_group_id . ", 12, NULL, now(),NULL,''),\n ('', 'Admin Display: Display List Maximum Length', 'RELATED_PRODUCTS_MAX_DISPLAY_LENGTH', '0', 'Sets the maximum length (in characters) of product name displayed in list. Enter \\'0\\' to set this option to false.', " . $set_group_id . ", 13, NULL, now(),NULL,''),\n ('', 'Admin Display: Use Product Model', 'RELATED_PRODUCTS_ADMIN_USE_MODEL', 'False', 'Uses Product Model in lists. When Product Name is also selected, Product Model is displayed first.', " . $set_group_id . ", 14, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Admin Display: Use Product Name', 'RELATED_PRODUCTS_ADMIN_USE_NAME', 'True', 'Uses Product Name in lists. When Product Model is also selected, Product Model is displayed first.', " . $set_group_id . ", 15, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Admin Display: Combine Model and Name separator', 'RELATED_PRODUCTS_ADMIN_MODEL_SEPARATOR', ': ', 'Enter the characters you would like to separate Model from Name, when using both. Leave empty if only using Model.', " . $set_group_id . ", 16, NULL, now(),NULL,''),\n ('', 'Admin Function: Use Delete Confirmation', 'RELATED_PRODUCTS_CONFIRM_DELETE', 'True', 'When set to True, a confirmation box will pop-up when deleting an association. Set to False to Delete without confirmation.', " . $set_group_id . ", 17, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Admin Function: Combine Insert with Inherit', 'RELATED_PRODUCTS_INSERT_AND_INHERIT', 'True', 'When set to True, clicking on Inherit will also Insert the product association. When False, Inherit works as before.', " . $set_group_id . ", 18, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),')\n ");
}
示例15: create
function create($s_name, $s_address, $s_contact, $s_phone, $s_outsourced = null, $s_scheduled = null, $safety_delivery_time = '0')
{
$s_outsourced = $s_outsourced == '1' ? '1' : '0';
$s_scheduled = $s_scheduled == '1' ? '1' : '0';
$sda = array();
$sda['suppliers_name'] = $s_name;
$sda['suppliers_address'] = $s_address;
$sda['suppliers_contact_person'] = $s_contact;
$sda['suppliers_contact_number'] = $s_phone;
$sda['suppliers_outsourced'] = $s_outsourced;
$sda['suppliers_scheduled'] = $s_scheduled;
$sda['safety_delivery_time'] = $safety_delivery_time;
tep_db_perform('elements_suppliers', $sda);
$this->id = tep_db_insert_id();
$this->setDetail($s_name, $s_address, $s_contact, $s_phone, $s_outsourced, $s_scheduled, $safety_delivery_time);
}