select prodcode, ordqty from ordersand your poor performing lookup (which pulls 10000 rows) is:
select prodcode,prodname from productsThen it is better to remove the lookupLens and change your $lens->sql to use a join:
select prodname, ordqty from orders, products
where orders.prodcode=products.prodcode
The tuner is activated when you define the following variable before the applet is called:
$PHPLENS_TUNER = array(100,array('products', 'customers'));
The first element of the array (100 here), is the maximum number of rows returned by a lookupLens before a warning is displayed. So a lookup on a table with 10 rows will not initiate a warning. The second element of the array is an array listing all tables that should not be included in lookupLens - this is useful when you have a small test database that you know will grow very big, so even though products and customers have less than 100 records each, you want a warning to appear.
.
Editing multiple records in a grid at one time is a very powerful feature in phpLens 2.0, but make sure that the user is actually editing multiple records, and not one record at a time. This is because there is a lot of extra checking and html generated (particularly for popup lists) when this feature is enabled.
$lens->lookupLens = "COLUMN^select name from table^!VIEW";This means display a popup when editing or creating records, but there is no need to generate lookups when in the VIEW or FILTERVIEW states.
So if you have complex new or edit forms, but you only want display to
a simple grid view, then the grid view sql can be set with: $lens->sql = '...' while
the new/edit form sql which accesses more fields is defined with $lens->sqlEditNew = '...'.
Similarly, we can define the detail view sql with $lens->sqlDetail = '...', and the
filter/search view with $lens->sqlFilter = '...'.
The properties sqlEditNew and sqlDetail require the keyCol property (primary key) to be defined. You do not need to put the primary key in the where clause of the sql, as the sql will be dynamically modified to access the correct record. Also dynamic editing in EDIT and NEW state is disabled when sqlEditNew is on.
$lens = new PHPLens(...); PHPLensLightFonts($lens); $lens->Render();Source code for this function is available in phplens-common.inc.php.
If you have multiple tables with the same field names, when you perform joins, it is possible that phplens will get confused as to which field is owned by which table. This is because of limitations of the database APIs. For best results, avoiding further heartache later, try to give your fields unique names.
For example, if you have a table called ACCOUNTS, prefix all field names with ACC_.