EllisLab/CodeIgniter — pull request #848 by jrmadsen67 (2011-12-30 01:37:21+00:00)
Title: Proposal to fix Issue:145 (https://github.com/EllisLab/CodeIgniter/issue...

...s/145) DB_Driver::query() to be given a 4th parameter, , which will allow use of a different bind_marker in bind queries

This is my first ever pull request, so I tried to follow the guidelines completely, but please let me know if I've missed something out.

This is to fix https://github.com/EllisLab/CodeIgniter/issues/145

When you are attempting to use a bind on a query that contains a "?", it fails. The simple solution was to allow the user to set his own bind marker.

I had two choices:

1) Add as an additional parameter - this allowed me to reset the bind_marker after each call to compile_binds(), making the "cleanup" unnecessary to the user.

2) Make _set_bind_marker() & _reset_bind_marker() public functions and have the user do it all manually.

So, I chose option #1.

Documentation:

I haven't yet added this because the existing 3rd parameter is also undocumented, so wasn't sure if we wanted to keep the User Guide a bit less cluttered. If I do add it, I would propose the Query Bindings section to be the best place for it.