Statement View code

A class defining a prepared database statement.

package

CMS

author

Robert Campbell

copyright

Copyright (c) 2017, Robert Campbell calguy1000@cmsmadesimple.org

since 2.2
property-read

The database connection

property-read

The SQL query.

Methods

__construct(\CMSMS\Database\Connection $conn, string $sql = null) 

Constructor

Arguments

\CMSMS\Database\Connection $conn

The database connection

string $sql

The SQL query

Bind(array $data) 

Bind data to the sql statements

Arguments

array $data

An array of arrays of data representing the numerous rows of the input data.

set_bound_data(array $data) 

Set bound data

abstract

Arguments

array $data

An array of arrays of data representing the numerous rows of the input data.

EOF() : boolean

Test if we are at the end of the resultset.

abstract

Response

boolean

MoveFirst() 

Move to the first record of the resultset.

abstract
MoveNext() 

Move to the next record of the resultset.

abstract
Fields(string $col = null) : mixed

Retrive data fields.

abstract

Arguments

string $col

The column name. If not specified, all columns will be returned.

Response

mixed

Execute() 

Execute the query

abstract

Properties

db

db : \CMSMS\Database\Connection

The database connection

Type(s)

\CMSMS\Database\Connection

sql

sql : string

The SQL query.

Type(s)

string