Rjfec
1
Just getting my feet wet with PHP and MYSQL, so I apologize if this seems like a simple question.
I need to add a parameter to a search function.
Currently I have
AND (this_field >= ? OR second_field >= ?)
I would like to add a field like so
AND (this_field >= ? OR second_field >= ? OR third_field >= ?)
Will that work? Any advise is appreciated.
So long as you also bind the third parameter or include it in the array when calling execute() you should be fine.
Rjfec
3
I am not sure what you mean by bind, but currently it is all wrapped up in a class. I then call the value if that makes sense?
Yes, that makes some sense, the reason I referred to bind was due to the ? placeholders shown in your query.
Here are a few of the possibilities on when those are used (they provide examples of what I was referring to)
http://www.php.net/manual/en/pdostatement.bindvalue.php
http://www.php.net/manual/en/pdostatement.bindparam.php
http://www.php.net/manual/en/pdostatement.execute.php