Subject Re: [firebird-php] FireBird/ADODB
Author Lester Caine
Alan McDonald wrote:
> I haven't looked that closely yet but afer a cursory glance I see a lot SQL
> with "LIMIT N" clauses. Makes me suspicious if ADODB would translate them or
> whether indeed the php code is built a lot around custom SQL.

Those are easy to fix - you just drop the 'LIMIT N' and add the third and
fourth parameters in the query function. Not taking care of it is just
laziness on the part of the coders.

Actually - I can only find one *IN* the program, the rest are in the drivers?

$db->Query("SELECT old_value, new_value
FROM {history}
WHERE field_changed = 'percent_complete'
AND task_id = ? AND old_value != '100'
ORDER BY event_date DESC
LIMIT 1",
array($task['task_id']));

Simply becomes

$db->Query("SELECT old_value, new_value
FROM {history}
WHERE field_changed = 'percent_complete'
AND task_id = ? AND old_value != '100'
ORDER BY event_date DESC",
array($task['task_id']), 1);

And you are laughing ;)

--
Lester Caine - G8HFL
-----------------------------
Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://home.lsces.co.uk
MEDW - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
Firebird Foundation Inc. - http://www.firebirdsql.org/index.php