Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > Database API > Methods

Database API:Query()

Scroll Prev Next More

 

Executes an SQL Query that returns data, i.e., SELECT * FROM TableName.

Syntax

DB::Query($SQL)

Arguments

$SQL

an SQL query.

Return value

A QueryResult object.

Example

$rs = DB::Query("select * from carsmake");
 
while( $data = $rs->fetchAssoc() )
{
echo $data["id"];
echo $data["make"];
}

See also:

QueryResult object: fetchAssoc()

Database API: Exec()

Database API: Select()

QueryResult object: fetchNumeric()

QueryResult object: value()

Using SQL variables

About Database API

 

Created with Help+Manual 7 and styled with Premium Pack Version 3 © by EC Software