|
Previous Page |
Solar_Sql_Select |
Next Page |
having()
public
Solar_Sql_Select
having (
string $cond,
string $val default '--5a333dc50d9341d8e73e56e2ba591b87'
)
Adds a HAVING condition to the query by AND.
Parameters
- (string)
$cond: The HAVING condition. - (string)
$val: A single value to quote into the condition.
Returns
- (Solar_Sql_Select)
Description
Adds a HAVING condition to the query by AND.
If a value is passed as the second param, it will be quoted and replaced into the condition wherever a question-mark appears.
Array values are quoted and comma-separated.
<?php
// simplest but non-secure
$select->having("COUNT(id) = $count");
// secure
$select->having('COUNT(id) = ?', $count);
// equivalent security with named binding
$select->having('COUNT(id) = :count');
$select->bind('count', $count);
?> Local
- Overview
- Constants
- Properties
- Methods
- __construct()
- __destruct()
- __toString()
- _addSource()
- _buildFrom()
- _buildJoin()
- _buildSelect()
- _exception()
- _join()
- _origAlias()
- apiVersion()
- bind()
- clear()
- countPages()
- distinct()
- dump()
- fetch()
- fetchAll()
- fetchAssoc()
- fetchCol()
- fetchOne()
- fetchPairs()
- fetchPdo()
- fetchSql()
- fetchValue()
- from()
- fromSelect()
- getPaging()
- group()
- having()
- innerJoin()
- join()
- leftJoin()
- limit()
- limitPage()
- locale()
- multiHaving()
- multiWhere()
- orHaving()
- orWhere()
- order()
- quote()
- quoteInto()
- quoteMulti()
- setPaging()
- unbind()
- where()