/** * Executes a query, and returns the first found row's first column's value. * Throws a warning if no rows were found. * * @param string $sql The SQL string. * @param mixed $binds The binds or a single bind. * * @return string|int **/ public function getOne($sql, $binds = array()) { $stmt = new AMysql_Statement($this); $stmt->query($sql, $binds); return $stmt->result(0, 0); }