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


PHP PearDatabase::quote方法代码示例

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


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

示例1: queryFilterone_of

 function queryFilterone_of(&$layout_def)
 {
     foreach ($layout_def['input_name0'] as $key => $value) {
         $layout_def['input_name0'][$key] = PearDatabase::quote($value);
     }
     return $this->_get_column_select($layout_def) . " IN ('" . implode("','", $layout_def['input_name0']) . "')\n";
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:7,代码来源:SugarWidgetFieldvarchar.php

示例2: add_create_assigned_user_name

 function add_create_assigned_user_name()
 {
     // global is defined in UsersLastImport.php
     global $imported_ids;
     global $current_user;
     if (empty($this->assigned_user_name)) {
         return;
     }
     $user_name = $this->assigned_user_name;
     // check if it already exists
     $focus = new User();
     $query = "select * from {$focus->table_name} WHERE user_name='{$user_name}'";
     $GLOBALS['log']->info($query);
     $result = $this->db->query($query) or sugar_die("Error selecting sugarbean: ");
     $row = $this->db->fetchByAssoc($result, -1, false);
     // we found a row with that id
     if (isset($row['id']) && $row['id'] != -1) {
         // if it exists but was deleted, just remove it entirely
         if (isset($row['deleted']) && $row['deleted'] == 1) {
             $query2 = "delete from {$focus->table_name} WHERE id='" . PearDatabase::quote($row['id']) . "'";
             $GLOBALS['log']->info($query2);
             $result2 = $this->db->query($query2) or sugar_die("Error deleting existing sugarbean: ");
         } else {
             $focus->id = $row['id'];
         }
     }
     // now just link the account
     $this->assigned_user_id = $focus->id;
     $this->modified_user_id = $focus->id;
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:30,代码来源:ImportLead.php

示例3: queryFilterone_of

 function queryFilterone_of(&$layout_def)
 {
     $arr = array();
     foreach ($layout_def['input_name0'] as $value) {
         array_push($arr, "'" . PearDatabase::quote($value) . "'");
     }
     $str = implode(",", $arr);
     return $this->_get_column_select($layout_def) . " IN (" . $str . ")\n";
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:9,代码来源:SugarWidgetFieldenum.php

示例4: build_generic_where_clause

 /**
 	builds a generic search based on the query string using or
 	do not include any $this-> because this is called on without having the class instantiated
 */
 function build_generic_where_clause($the_query_string)
 {
     $where_clauses = array();
     $the_query_string = PearDatabase::quote(from_html($the_query_string));
     array_push($where_clauses, "leads.last_name like '{$the_query_string}%'");
     array_push($where_clauses, "leads.account_name like '{$the_query_string}%'");
     array_push($where_clauses, "leads.first_name like '{$the_query_string}%'");
     array_push($where_clauses, "leads.email1 like '{$the_query_string}%'");
     array_push($where_clauses, "leads.email2 like '{$the_query_string}%'");
     if (is_numeric($the_query_string)) {
         array_push($where_clauses, "leads.phone_home like '%{$the_query_string}%'");
         array_push($where_clauses, "leads.phone_mobile like '%{$the_query_string}%'");
         array_push($where_clauses, "leads.phone_work like '%{$the_query_string}%'");
         array_push($where_clauses, "leads.phone_other like '%{$the_query_string}%'");
         array_push($where_clauses, "leads.phone_fax like '%{$the_query_string}%'");
     }
     $the_where = "";
     foreach ($where_clauses as $clause) {
         if ($the_where != "") {
             $the_where .= " or ";
         }
         $the_where .= $clause;
     }
     return $the_where;
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:29,代码来源:Lead.php

示例5: build_generic_where_clause

 /**
  *
  */
 function build_generic_where_clause($the_query_string)
 {
     $where_clauses = array();
     $the_query_string = PearDatabase::quote(from_html($the_query_string));
     array_push($where_clauses, "ink.name LIKE '%{$the_query_string}%'");
     $the_where = '';
     foreach ($where_clauses as $clause) {
         if ($the_where != '') {
             $the_where .= " OR ";
         }
         $the_where .= $clause;
     }
     return $the_where;
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:17,代码来源:Ink.php

示例6: build_generic_where_clause

 /**
 	builds a generic search based on the query string using or
 	do not include any $this-> because this is called on without having the class instantiated
 */
 function build_generic_where_clause($the_query_string)
 {
     $where_clauses = array();
     $the_query_string = PearDatabase::quote(from_html($the_query_string));
     array_push($where_clauses, "cases.name like '{$the_query_string}%'");
     array_push($where_clauses, "accounts.name like '{$the_query_string}%'");
     if (is_numeric($the_query_string)) {
         array_push($where_clauses, "cases.case_number like '{$the_query_string}%'");
     }
     $the_where = "";
     foreach ($where_clauses as $clause) {
         if ($the_where != "") {
             $the_where .= " or ";
         }
         $the_where .= $clause;
     }
     if ($the_where != "") {
         $the_where = "(" . $the_where . ")";
     }
     return $the_where;
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:25,代码来源:Case.php

示例7: array

     $current_user_only = $_REQUEST['current_user_only'];
 }
 if (isset($_REQUEST['assigned_user_id'])) {
     $assigned_user_id = $_REQUEST['assigned_user_id'];
 }
 //if (isset($_REQUEST['spec'])) $spec = $_REQUEST['spec'];
 //if (isset($_REQUEST['subordinate_only'])) $subordinate_only = $_REQUEST['subordinate_only'];
 $where_clauses = array();
 if (isset($name) && $name != "") {
     array_push($where_clauses, "products.name like '%" . PearDatabase::quote($name) . "%'");
 }
 if (isset($pnum) && $pnum != "") {
     array_push($where_clauses, "products.pnum like '%" . PearDatabase::quote($pnum) . "%'");
 }
 if (isset($category) && $category != "") {
     array_push($where_clauses, "products.category like '%" . PearDatabase::quote($category) . "%'");
 }
 //if(isset($type) && $type != "") array_push($where_clauses, "products.type like '%".PearDatabase::quote($type)."%'");
 if (isset($current_user_only) && $current_user_only != "") {
     array_push($where_clauses, "products.assigned_user_id='{$current_user->id}'");
 }
 /*
 	//search by modified date.
 	$date_period = '';
 	if (isset($_REQUEST['date_period'])) $date_period = $_REQUEST['date_period'];
 	if($date_period == "cust"){
 		if (isset($_REQUEST['date_from'])) $date_from = $_REQUEST['date_from'];
 		if (isset($_REQUEST['date_to'])) $date_to = $_REQUEST['date_to'];
 		
 	}else{
 		$date_from = get_date_from($date_period);
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:ListView.php

示例8: StoreQuery

require_once 'modules/MySettings/StoreQuery.php';
$storeQuery = new StoreQuery();
if ($_REQUEST['action'] == 'index') {
    if (!isset($_REQUEST['query'])) {
        $storeQuery->loadQuery($currentModule);
        $storeQuery->populateRequest();
    } else {
        $storeQuery->saveFromGet($currentModule);
    }
}
if (isset($_REQUEST['query'])) {
    // we have a query
    $searchForm->populateFromRequest();
    if (!empty($_REQUEST['date_closed']) && !empty($_REQUEST['date_start'])) {
        // this is to handle dashboard queries
        $whereAdditional = "opportunities.date_closed >= '" . PearDatabase::quote($_REQUEST['date_start']) . "' and opportunities.date_closed <= '" . PearDatabase::quote($_REQUEST['date_closed']) . "'";
        if (isset($searchForm->searchFields['date_closed'])) {
            unset($searchForm->searchFields['date_closed']);
        }
    }
    $where_clauses = $searchForm->generateSearchWhere($_REQUEST, true, "Opportunities");
    // First change the query string value for sales_stage
    $position = array_search("opportunities.sales_stage = 'Other'", $where_clauses);
    if ($position !== false) {
        $where_clauses[$position] = "opportunities.sales_stage not in ('Closed Won', 'Closed Lost')";
        // Same as: ("SELECT DISTINCT sales_stage from opportunities where sales_stage not in ('Closed Won', 'Closed Lost')")
    }
    if (isset($whereAdditional)) {
        array_push($where_clauses, $whereAdditional);
    }
    $where = "";
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:ListView.php

示例9: add_create_assigned_user_name

 function add_create_assigned_user_name()
 {
     // global is defined in UsersLastImport.php
     global $imported_ids;
     global $current_user;
     if (empty($this->assigned_real_user_name)) {
         return;
     }
     $arr = array();
     $name_arr = preg_split('/\\s+/', $this->assigned_real_user_name);
     if (count($name_arr) == 1) {
         $first_name = $this->assigned_real_user_name;
     } else {
         $first_name = array_shift($name_arr);
         $last_name = join(' ', $name_arr);
     }
     if (empty($last_name)) {
         $user_name = strtolower($first_name);
     } else {
         $user_name = strtolower($first_name . '_' . $last_name);
     }
     $user_name = preg_replace('/[^A-Za-z_]+/', '_', $user_name);
     $arr = array();
     // check if it already exists
     $focus = new User();
     $query = "select * from {$focus->table_name} WHERE (first_name='" . PearDatabase::quote($first_name) . "' AND last_name='" . PearDatabase::quote($last_name) . "') OR user_name='{$user_name}'";
     $GLOBALS['log']->info($query);
     $result = $this->db->query($query) or sugar_die("Error selecting sugarbean: ");
     $row = $this->db->fetchByAssoc($result, -1, false);
     // we found a row with that id
     if (isset($row['id']) && $row['id'] != -1) {
         // if it exists but was deleted, just remove it entirely
         if (isset($row['deleted']) && $row['deleted'] == 1) {
             $query2 = "delete from {$focus->table_name} WHERE id='" . PearDatabase::quote($row['id']) . "'";
             $GLOBALS['log']->info($query2);
             $result2 = $this->db->query($query2) or sugar_die("Error deleting existing sugarbean: ");
         } else {
             $focus->id = $row['id'];
         }
     }
     // now just link the account
     $this->assigned_user_id = $focus->id;
     $this->modified_user_id = $focus->id;
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:44,代码来源:ImportProspect.php

示例10: build_generic_where_clause

 /**
 	builds a generic search based on the query string using or
 	do not include any $this-> because this is called on without having the class instantiated
 */
 function build_generic_where_clause($the_query_string)
 {
     $where_clauses = array();
     $the_query_string = PearDatabase::quote(from_html($the_query_string));
     array_push($where_clauses, "name like '{$the_query_string}%'");
     $the_where = "";
     foreach ($where_clauses as $clause) {
         if ($the_where != "") {
             $the_where .= " or ";
         }
         $the_where .= $clause;
     }
     return $the_where;
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:18,代码来源:Release.php

示例11: Role

    if (!isset($_REQUEST['query'])) {
        $storeQuery->loadQuery($currentModule);
        $storeQuery->populateRequest();
    } else {
        $storeQuery->saveFromGet($currentModule);
    }
}
$seedRole = new Role();
if (isset($_REQUEST['query'])) {
    // we have a query
    if (isset($_REQUEST['name'])) {
        $name = $_REQUEST['name'];
    }
    $where_clauses = array();
    if (isset($name) && $name != "") {
        array_push($where_clauses, "roles.name like '" . PearDatabase::quote($name) . "%'");
    }
    $seedRole->custom_fields->setWhereClauses($where_clauses);
    $where = "";
    foreach ($where_clauses as $clause) {
        if ($where != "") {
            $where .= " and ";
        }
        $where .= $clause;
    }
    $GLOBALS['log']->info("Here is the where clause for the list view: {$where}");
}
if (!isset($_REQUEST['search_form']) || $_REQUEST['search_form'] != 'false') {
    // Stick the form header out there.
    $search_form = new XTemplate('modules/Roles/SearchForm.html');
    $search_form->assign("MOD", $current_module_strings);
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:ListView.php

示例12: setWhereClauses

 function setWhereClauses(&$where_clauses)
 {
     if (!array_key_exists($this->module, $this->modules)) {
         return false;
     }
     foreach ($this->avail_fields as $name => $value) {
         if (!empty($_REQUEST[$name])) {
             array_push($where_clauses, $this->bean->table_name . "_cstm.{$name} LIKE '" . PearDatabase::quote($_REQUEST[$name]) . "%'");
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:11,代码来源:DynamicField.php

示例13: queryFilterBetween_Dates

 function queryFilterBetween_Dates(&$layout_def)
 {
     global $timedate;
     if ($this->getAssignedUser()) {
         $begin = $timedate->handle_offset($layout_def['input_name0'], $timedate->dbDayFormat, false, $this->assigned_user);
         $end = $timedate->handle_offset($layout_def['input_name1'], $timedate->dbDayFormat, false, $this->assigned_user);
     } else {
         $begin = $layout_def['input_name0'];
         $end = $layout_def['input_name1'];
     }
     return "(" . $this->_get_column_select($layout_def) . ">='" . PearDatabase::quote($begin) . "' AND \n" . $this->_get_column_select($layout_def) . "<='" . PearDatabase::quote($end) . "')\n";
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:12,代码来源:SugarWidgetFielddate.php

示例14: queryFilterBetween

 function queryFilterBetween(&$layout_def)
 {
     return $this->_get_column_select($layout_def) . " BETWEEN '" . PearDatabase::quote($layout_def['input_name0']) . "' AND '" . PearDatabase::quote($layout_def['input_name1']) . "'\n";
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:4,代码来源:SugarWidgetFieldint.php

示例15: build_generic_where_clause

 /**
 	builds a generic search based on the query string using or
 	do not include any $this-> because this is called on without having the class instantiated
 */
 function build_generic_where_clause($the_query_string)
 {
     $where_clauses = array();
     $the_query_string = PearDatabase::quote(from_html($the_query_string));
     array_push($where_clauses, "suppliers.name like '{$the_query_string}%'");
     if (is_numeric($the_query_string)) {
         array_push($where_clauses, "suppliers.phone_alternate like '%{$the_query_string}%'");
         array_push($where_clauses, "suppliers.phone_fax like '%{$the_query_string}%'");
         array_push($where_clauses, "suppliers.phone_office like '%{$the_query_string}%'");
     }
     $the_where = "";
     foreach ($where_clauses as $clause) {
         if (!empty($the_where)) {
             $the_where .= " or ";
         }
         $the_where .= $clause;
     }
     return $the_where;
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:23,代码来源:Supplier.php


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