Horde_Db_Adapter_Base::selectValue PHP Method

selectValue() public method

Returns a single value from a record
public selectValue ( string $sql, mixed $arg1 = null, string $arg2 = null ) : string
$sql string SQL statement.
$arg1 mixed Either an array of bound parameters or a query name.
$arg2 string If $arg1 contains bound parameters, the query name.
return string
    public function selectValue($sql, $arg1 = null, $arg2 = null)
    {
        $result = $this->selectOne($sql, $arg1, $arg2);
        return $result ? next($result) : null;
    }

Usage Example

Esempio n. 1
0
 /**
  * Returns a timestamp stored in the map for a given Server ID.
  *
  * The timestamp is the timestamp of the last change to this server ID
  * that was done inside a sync session (as a result of a change received
  * by the server). It's important to distinguish changes in the backend a)
  * made by the user during normal operation and b) changes made by SyncML
  * to reflect client updates.  When the server is sending its changes it
  * is only allowed to send type a). However the history feature in the
  * backend my not know if a change is of type a) or type b). So the
  * timestamp is used to differentiate between the two.
  *
  * @param string $databaseURI  URI of database to sync. Like calendar,
  *                             tasks, contacts or notes. May include
  *                             optional parameters:
  *                             tasks?options=ignorecompleted.
  * @param string $suid         The server ID.
  *
  * @return mixed  The previously stored timestamp or false if no entry is
  *                found.
  */
 protected function _getChangeTS($databaseURI, $suid)
 {
     $database = $this->normalize($databaseURI);
     $query = 'SELECT syncml_timestamp FROM horde_syncml_map ' . 'WHERE syncml_syncpartner = ? AND syncml_db = ? AND ' . 'syncml_uid = ? AND syncml_suid = ?';
     $values = array($this->_syncDeviceID, $database, $this->_user, $suid);
     return $this->_db->selectValue($query, $values);
 }
All Usage Examples Of Horde_Db_Adapter_Base::selectValue