Ido Trivizki wrote:

>I would like to suggest an as_string function that would work like:
>$sth=$dbh->prepare('SELECT foo FROM bar WHERE baz=?');
>$sth->as_string('blah');
>
try: sth->{Statement}

>
>
>Will print:
>
>SELECT foo FROM bar WHERE baz='blah'
>
>And maybe even:
>$dbh->as_string('DELETE FROM foo WHERE bar=?',undef,"can't");
>
>Which should usually print:
>
>DELETE FROM foo WHERE bar='can''t'
>
>I think such a method can be very helpful for debugging. Right now I simply copy the 
>->do line and change it to sprintf with %s's..
>
>Thanks.
>Ido.
>

Reply via email to