[Solar-talk] Disturbing Solar_Sql_Select problem

Paul M Jones pmjones at ciaweb.net
Sun Feb 25 10:56:58 PST 2007


On Feb 25, 2007, at 12:30 PM, Rodrigo Moraes wrote:

> When I switched back to PHP 5.2.0, no exceptions were thrown after
> several tries.

*Definitely* the new 5.2.1 behavior then.


>> Also, if you try it directly with a PDO object proper, does it throw
>> the same exception?
>
> It seems that no. I tried this and it works fine every time (5.2.0  
> and 5.2.1):
>
>     $stmt = "SELECT games_game.* FROM games_game WHERE title = ?  
> LIMIT 1";
>     $obj = Solar::registry('sql')->getPdo()->prepare($stmt);
>     $obj->execute(array('TONY HAWK\'s PROJECT 8'));
>     $res = $obj->fetch(PDO::FETCH_ASSOC);
>     var_dump($res);

This confirms my opinion.  If you were to add $obj->bind(array())  
before executing, you'd get the same exception in 5.2.1.

Part of the Solar portion of the error is due to assumptions query()  
has about how PDO treats binding.  The behaviors there are different  
in 5.2.1 than they were in 5.2.0 and previous.  Take a look at the  
comments in model-branch Solar_Sql_Adapter::query() for more info;  
I'll write more about this later, and probably blog it too.

So for now, guys, stay off 5.2.1; I'll push the model-branch solution  
to trunk in the next day or two.  Thanks for your patience in the  
mean time.



--

Paul M. Jones  <http://paul-m-jones.com>

Solar: Simple Object Library and Application Repository
for PHP5.  <http://solarphp.com>

Join the Solar community wiki!  <http://solarphp.org>

Savant: The simple, elegant, and powerful solution for
templates in PHP.  <http://phpsavant.com>




More information about the solar-talk mailing list