|
Posted by Tim Van Wassenhove on 07/30/05 19:19
On 2005-07-30, richard <Richard@localhost.localdomain> wrote:
> Tim Van Wassenhove wrote:
>
>> On 2005-07-30, richard <richard@localhost.localdomain> wrote:
>>> I work for a company called zedcore.com, and we code php for money. We
>>> have solved this issue. I'll explain what we have done.
>>
>> [snip code]
>>
>> These are a couple of questions i have with a lot of classes/functions
>> that proclaim the query generation:
>>
>> - Does it allow you add a column LIKE 'value%' instead of
>> column='value'?
>>
>> - Does it allow you to have a "complex" condition like
>> column=MAX(column) or is that translated to column='MAX(column)'?
>>
>> - How does it handle with values like O'Reilly? (It would be silly if
>> you have to escape the value yourself.)
> When doing complex searching for recordset based stuff - where say a field
> is an integer and the search is a range between two values you have two
> cases. One, is that the query is a system query and so a little bit of
> query building may be required. The other is that the search is based on
> user input. In which case we build a form using an administration block (a
> type of class) that can also show the results in a Sorter-Pager.
I'm aware of the approaches. I was just curious to see implementations
;)
Currently i prefer to accept a WHERE clause but as a prepared statement.
So the code looks like: $model->get("foo > ?", array(10));
--
Met vriendelijke groeten,
Tim Van Wassenhove <http://timvw.madoka.be>
[Back to original message]
|