medoo::get PHP Méthode

get() public méthode

public get ( $table, $join = null, $column = null, $where = null )
    public function get($table, $join = null, $column = null, $where = null)
    {
        $query = $this->query($this->select_context($table, $join, $column, $where) . ' LIMIT 1');
        if ($query) {
            $data = $query->fetchAll(PDO::FETCH_ASSOC);
            if (isset($data[0])) {
                $column = $where == null ? $join : $column;
                if (is_string($column) && $column != '*') {
                    return $data[0][$column];
                }
                return $data[0];
            } else {
                return false;
            }
        } else {
            return false;
        }
    }

Usage Example

Exemple #1
0
 /**
  * @param      $table
  * @param      $columns
  * @param null $where
  * @return bool|array
  */
 public function get($table, $columns, $where = NULL)
 {
     if (empty($this->_reader)) {
         return $this->_writer->get($table, $columns, $where);
     } else {
         return $this->_reader->get($table, $columns, $where);
     }
 }
All Usage Examples Of medoo::get