0

I am trying to use MySQLi prepared statement to insert values in ProfileImg column and I want to use WHERE clause with it, how should I implement this?

Here is my current code:

    [TRUNCATED]
    $userid = $_POST['userid'];
    $stmt = $conn->prepare("INSERT INTO Users (ProfileImg) VALUES (?) WHERE ID=?");
    $stmt->bind_param("si", $file, $userid);

    // set parameters and execute
    $stmt->execute();
    echo "succeeded";

    $stmt->close();
    $conn->close();
    ?>
Abdullah
  • 31
  • 4
  • 1
    A `WHERE` clause on an `INSERT` doesn't make any sense. What are you trying to do? Do you actually want an `UPDATE`? – Alex Howansky Aug 09 '18 at 15:31
  • Thank you so much! Much appreciated! UPDATE did not come to my mind for unknown reason, sorry about that. – Abdullah Aug 09 '18 at 15:35

0 Answers0