PHP Warning: mysqli_stmt::bind_param(): Number of variables doesn't match number of parameters in prepared statement

后端 未结 2 1305
深忆病人
深忆病人 2020-12-11 06:31

Not sure why I\'m getting this PHP warning message. It appears there are four parameters in the prepared statement, and also four variables in bind_param(). Thanks for any

2条回答
  •  春和景丽
    2020-12-11 07:27

    You do not need to bind parameters in this case. Placeholders are used for the values in an INSERT statement, or in a WHERE clause. (Note that placeholders are not allowed for identifiers, such as the column names in your statement.) A valid, simplified statement with placeholders would look like:

    "SELECT url, cover_image FROM back_issues WHERE month = ? and year = ?"
    

提交回复
热议问题