Skip to content
Advertisement

How to UPDATE in database using mysqli prepared statement?

I’m using mysqli before to my query and now I convert it to mysqli prepared statements. I’m trying to update a particular data with upload image and I don’t know why I get the error

mysqli_stmt_bind_result(): Number of bind variables doesn’t match number of fields in prepared statement in line 30

Also, how can I execute the query in mysqli query like mysqli_query($conn, $query)

Below is the code of my UPDATE query:

JavaScript

In the code above, there is a comment line on how to execute the query. How can I do that?

When I click the button Upload, it says that the image is uploaded but does not appear in the database. Why is that?

Advertisement

Answer

For procedural way

JavaScript

Try this out in object-oriented style

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement