You are here

protected function OAuthStoreMySQLi::query_one in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.7 lib/oauth-php/library/store/OAuthStoreMySQLi.php \OAuthStoreMySQLi::query_one()
  2. 7.2 lib/oauth-php/library/store/OAuthStoreMySQLi.php \OAuthStoreMySQLi::query_one()
  3. 7.3 lib/oauth-php/library/store/OAuthStoreMySQLi.php \OAuthStoreMySQLi::query_one()
  4. 7.4 lib/oauth-php/library/store/OAuthStoreMySQLi.php \OAuthStoreMySQLi::query_one()
  5. 7.6 lib/oauth-php/library/store/OAuthStoreMySQLi.php \OAuthStoreMySQLi::query_one()

* Perform a query, return the first column of the first row * *

Parameters

string sql: * @param vararg arguments (for sprintf) * @return mixed

Overrides OAuthStoreMySQL::query_one

File

lib/oauth-php/library/store/OAuthStoreMySQLi.php, line 216

Class

OAuthStoreMySQLi

Code

protected function query_one($sql) {
  $sql = $this
    ->sql_printf(func_get_args());
  if (!($res = mysqli_query($this->conn, $sql))) {
    $this
      ->sql_errcheck($sql);
  }
  if ($row = mysqli_fetch_assoc($res)) {
    $val = array_pop($row);
  }
  else {
    $val = false;
  }
  mysqli_free_result($res) || is_object($res) && get_class($res) == "mysqli_result" ? true : false;
  return $val;
}