note 105444 modified in mysqli-stmt.execute by mez
| From: | mez@php.net | Date: | Thu, 18 Aug 2011 14:34:11 +0000 |
| Subject: | note 105444 modified in mysqli-stmt.execute by mez | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-182561@lists.php.net to get a copy of this message | ||
Re: Note by vedran-b at email dot htnet dot hr
I don't know what he managed to do, but under normal circumstances bind_param() does NOT by
itself alter the value of the variables passed as arguments.
They are however passed by reference, so if you change them after calling bind_param(), the changed
values will be used the next time you call execute().
This is due to the original purpose of parametrised statements - it allows you to run the same query
repeatedly changing only the input and receiving different output: you only need to call prepare(),
bind_param() and (optionally) bind_result() once, then you loop as many times as needed calling
execute() on each iteration.
--was--
Re: Note by vedran-b at email dot htnet dot hr
I don't know what he managed to do, but under normal circumstances bind_param() does NOT by
itself alter the value of the variables passed as arguments.
They are however passed by reference, so if you change them after calling bind_param(), the changed
values will be used the next time you call execute().
This is due to the original purpose of parametrised statements - it allows you to run the same query
repeatedly changing only the input and receiving different output: you only need to call prepare(),
bind_param() and (optionally) bind_result() once, then you loop as many times as needed calling
execute() on each iteration.
http://php.net/manual/en/mysqli-stmt.execute.php