Store Community Support Documentation
Viewing Single Post
Originally posted by: Aileen Marcell

Even so, if you develop your own module and use this query, you don't need to follow the regular PhpFox's strategy, so you can directly store the query in a variable and send it to the data base.

Not exactly true. There are a number of cases where fox will trigger errors or reject statements. There really is no way to send any query directly to the database unless you circumvent the database interface.

A feature request is needed.

This example is contrived but exhibits one issue:

Phpfox::getLib('database')->query("UPDATE phpfox2_user SET full_name='fred' WHERE user_name='steward';UPDATE phpfox2_user SET user_name='fred' WHERE user_id=2");

SQL does this no problem. But Phpfox triggers an error.

There's another, long forgotten now... if I played with the IN() clause I could find it again. Basically fox has reduced all of us to the lowest common denominator of sql.

Which is fine.

But seriously don't kill yourself trying to use the phpfox database library unless you are doing exactly what fox has anticipated.

Compound queries or offbeat constructs require PDO.

Many hours lost here.

It is not the case that you can send arbitrary queries to the database.