Back
sql
Essential
sql
Holds the SQL string sent to the database
Default:
This property is also the 3rd parameter in the phpLens constructor.

This SQL statement can be a SELECT statement or stored procedure.

Don't do this: currently avoid using SELECT UNION statements, and do not place a limit on the rows returned yourself with SELECT TOP nrows from TABLE or SELECT * FROM TABLE LIMIT nrows.

If you need to limit the number of rows returned, look in the phplens.inc.php file and you will see a constant defined:

define ('PHPLENS_MAX_ROWS',99999999); // 9.9 million

Redefine this constant to control the maximum records to return.

In phpLens 1.1 onwards, you can access global PHP variables in the SQL if you prefix the SQL with = or %:

=select * from table where col='$key'
=select * from table where id='$HTTP_COOKIE_VARS['key']'
=select * from {$country}codes

Syntax
$lens = new phpLens($id,$DB,"=select * from $table");

$lens->sql = 'select * from catalog';

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]