if(mysqli_stmt_prepare($stmt_2,$query_2)) {
Manual shows to test like the above.
Can we not test:
if(mysqli_stmt_execute($stmt_2); {
And, not test ?:
if(mysqli_stmt_bind_param($stmt_2,'s',$keywords); {
developer_web
That's not valid PHP. I'm not sure what you're asking for here--I guess the answer is no?
Nachfolger
Why this no valid ? Just checking if execution went ahead or not.
Why this no valid ? Just checking if params got bound or not.
It depends on whether you're willing to accept the consequences if something fails. If you do a mysqli_stmt_prepare() and it fails, then any subsequent command that tries to use that prepared statement is going to fail, and likely by throwing an exception or fatal error, as opposed to just returning false.
mysqli_stmt_prepare()
Yet another advantage of PDO: it's relatively easy to configure it to always throw exceptions on errors, allowing you to explicitly catch them in try/catch blocks.
Go ahead and try it out, tell me why it isn't valid.