BillKarwin wrote:
> 
> Be aware that query() internally does a prepare() and execute(), so  
> running execute() a second time is unnecessary.  Also, unless your  
> UPDATE is idempotent, you could change your data in ways you don't  
> intend.  If you had interpolated the values into the SQL string and  
> executed it twice, it would swap 21 and 22 and then by executing  
> again, it would swap them back to their original rows!  :-)
> 
> But in your example, the second call to execute() should fail anyway,  
> because the query expects parameters but you aren't passing any.
> 

Thanks for the heads up on that one.  I tired it a few times and nothing
seemed to be happening.  Taking out that execute() call fixed it right up. 
Seems a prepared query can be executed for some odd reason.

I think I'll proceed with the coded query now that i have it working anyhow. 
Stored Procedures for another day.  Thanks to everyone for the feedback.

--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Complex-UPDATE-statement-Best-method-tp3347426p3350128.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to