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


PHP SQLQBuilder::quoteCorrect方法代码示例

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


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

示例1: addTimesheet

 /**
  * Add a new timesheet
  *
  * Status will be overwritten
  */
 public function addTimesheet()
 {
     $newId = UniqueIDGenerator::getInstance()->getNextID(self::TIMESHEET_DB_TABLE_TIMESHEET, self::TIMESHEET_DB_FIELD_TIMESHEET_ID);
     $this->setTimesheetId($newId);
     if ($this->getStartDate() == '' || $this->getEndDate() == '') {
         $this->_getNewDates();
     }
     $this->setStatus(self::TIMESHEET_STATUS_NOT_SUBMITTED);
     $sql_builder = new SQLQBuilder();
     $insertTable = self::TIMESHEET_DB_TABLE_TIMESHEET;
     $insertFields[0] = "`" . self::TIMESHEET_DB_FIELD_TIMESHEET_ID . "`";
     $insertFields[1] = "`" . self::TIMESHEET_DB_FIELD_EMPLOYEE_ID . "`";
     $insertFields[2] = "`" . self::TIMESHEET_DB_FIELD_TIMESHEET_PERIOD_ID . "`";
     $insertFields[3] = "`" . self::TIMESHEET_DB_FIELD_START_DATE . "`";
     $insertFields[4] = "`" . self::TIMESHEET_DB_FIELD_END_DATE . "`";
     $insertFields[5] = "`" . self::TIMESHEET_DB_FIELD_STATUS . "`";
     $insertValues[0] = $this->getTimesheetId();
     $insertValues[1] = $this->getEmployeeId();
     $insertValues[2] = $this->getTimesheetPeriodId();
     $insertValues[3] = "'" . $this->getStartDate() . "'";
     $insertValues[4] = "'" . $this->getEndDate() . "'";
     $insertValues[5] = $this->getStatus();
     $insertValues = $sql_builder->quoteCorrect($insertValues);
     $query = $sql_builder->simpleInsert($insertTable, $insertValues, $insertFields);
     $dbConnection = new DMLFunctions();
     $result = $dbConnection->executeQuery($query);
     if ($result && mysql_affected_rows() > 0) {
         return true;
     }
     return false;
 }
开发者ID:noikiy,项目名称:owaspbwa,代码行数:36,代码来源:Timesheet.php

示例2: updateProject

 /**
  * Update project information
  */
 public function updateProject()
 {
     if ($this->_isDuplicateName(true)) {
         throw new ProjectsException("Duplicate name", 1);
     }
     $sql_builder = new SQLQBuilder();
     $updateTable = self::TABLE_NAME;
     if ($this->getCustomerId() != null) {
         $updateFields[] = "`" . self::PROJECT_DB_FIELD_CUSTOMER_ID . "`";
         $updateValues[] = "'" . $this->getCustomerId() . "'";
     }
     if ($this->getProjectName() != null) {
         $updateFields[] = "`" . self::PROJECT_DB_FIELD_NAME . "`";
         $updateValues[] = "'" . $this->getProjectName() . "'";
     }
     if ($this->getProjectDescription() != null) {
         $updateFields[] = "`" . self::PROJECT_DB_FIELD_DESCRIPTION . "`";
         $updateValues[] = "'" . $this->getProjectDescription() . "'";
     }
     if ($this->getDeleted() != null) {
         $updateFields[] = "`" . self::PROJECT_DB_FIELD_DELETED . "`";
         $updateValues[] = $this->getDeleted();
     }
     $updateConditions[] = "`" . self::PROJECT_DB_FIELD_PROJECT_ID . "` = {$this->getProjectId()}";
     if (is_array($updateFields)) {
         $updateValues = $sql_builder->quoteCorrect($updateValues);
         $sqlQString = $sql_builder->simpleUpdate($updateTable, $updateFields, $updateValues, $updateConditions);
         $dbConnection = new DMLFunctions();
         $message2 = $dbConnection->executeQuery($sqlQString);
         //Calling the addData() function
         // We don't check mysql_affected_rows here since the update may not have changed any
         // of the database fields.
         if ($message2) {
             return true;
         }
     }
     return false;
 }
开发者ID:googlecode-mirror,项目名称:pucit-orangehrm,代码行数:41,代码来源:Projects.php


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