Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
84 lines (61 sloc) 2.23 KB

getASSOC / PgetASSOC

Executes the SQL and returns an associative array for the given query.

If the number of columns returned is greater to two, a 2-dimensional array is returned, with the first column of the recordset becomes the keys to the rest of the rows. If the columns is equal to two, a 1-dimensional array is created, where the the keys directly map to the values.

If an error occurs, false is returned.

Parameters

getASSOC($sql)
$sql:The MySQL query to perfom on the database.

Prepared statements Parameters

PgetASSOC($sql, $varN)
$sql:The MySQL query to perfom on the database
$varN:The variable(s) that will be placed instead of the ? placeholder separated by a ',' or it can be the method Prepare.

Example

Output of print_r($rs):