Re: mysqli sql question
| From: | James Yerge | Date: | Wed, 31 Aug 2011 11:40:55 +0000 |
| Subject: | Re: mysqli sql question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-314669@lists.php.net to get a copy of this message | ||
On 08/31/2011 05:23 AM, Peet Grobler wrote:
> Is it possible to get the actual sql that is being used to query or
> update the database?
>
> E.g
> $sth = $dbh->prepare ("update table set field=?, field2=? where id=?);
> mysqli_bind_param ($sth, 'ssi', 'text1', 'text2', 10);
> $sth->execute();
>
> Something like $sth->sql? Or $dbh->sql?
>
> I want to see "update table set field='text1', field2='text2' where
> id=10;
>
>
> Thanks in advance,
> Peet
>
Look up the EXPLAIN SQL function call.