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


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.


$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.


Output of print_r($rs):