My site is rather extensive, and I just recently made the switch to PHP5 (call me a late bloomer).
All of my MySQL query's before were built as such:
"SELECT * FROM tablename WHERE field1 = 'value' && field2 = 'value2'";
This made it very easy, simple and friendly.
I am now trying to make the switch to mysqli for obvious security reasons, and I am having a hard time figuring out how to implement the same SELECT * FROM
queries when the bind_param
requires specific arguments.
Is this statement a thing of the past?
If it is, how do I handle a query with tons of columns involved? Do I really need to type them all out every time?
becomes
which is passed to the
$mysqli::prepare
:OP comments:
Right, one type specifier per
?
parameter in the prepared statement, all of them positional (first specifier applies to first?
which is replaced by first actual parameter (which is the second parameter tobind_param
)).mysqli will take care of escaping and quoting (I think).