ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:param

param

See Also

addQ()

Syntax
string param(
       string $name
       )

Description

The function param returns a database-specific placeholder for a prepared query statement.

This method is used with bind variable SQL statement execution, to produce injection resistant code.


Usage

/*
* Connection to Oracle database
*/
print $db->param('account');
/*
* prints ':account'
*/
/*
* Connection to IBM DB2 database
*/
print $db->param('account');
/*
* prints ?
*/
/*
* Connection to Postgres database
*/
print $db->param('account');
/*
* prints $1
*/
v5/reference/connection/param.txt · Last modified: 2018/07/21 02:08 by mnewnham