Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8944265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:59:01+00:00 2026-06-15T11:59:01+00:00

The below prepared statement has 5 variables. INSERT INTO folder (folder_name, folder_parent_id, folder_user_id, folder_order,

  • 0

The below prepared statement has 5 variables.

INSERT INTO folder (folder_name, folder_parent_id, folder_user_id, folder_order, hk_created) VALUES (?,?,?,?,?);

I’m getting this warning when I call $_STATEMENT->bind_result( $_RESULT );

Warning: mysqli_stmt::bind_result(): Number of bind variables doesn't match number of fields in prepared statement

While obviously this is true ( 5 variables, 1 result variable ) an INSERT statement when executed only returns true (success) or false (failure). Just in case there were something I were missing, I tried providing 5 variables to bind_result() and I still got the same message.

The Insert query executes successfully. Should I just @suppress the warning and chalk this up as either a quirk or bug in PHP (sometimes I wonder if there is a difference) or is there something I’m missing?

Edited to reflect that I tried giving 5 variables to bind_result()

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:59:03+00:00Added an answer on June 15, 2026 at 11:59 am

    You can’t use bind_result with an INSERT query. It doesn’t have a result.

    $_STATEMENT->execute() will return TRUE or FALSE. Use $_STATEMENT->affected_rows if you want to see how many rows were inserted.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The below prepared statement doesn't insert into the database. $sid =1; $sid2 = $GET['sid2'];
I want to use prepared statement to insert and update data in mysqli, Below
I'm having trouble getting a prepared statement in sqlite3 to work. I'm working with
Hello all, This query below contains the prepared statement that I would like to
I have the below questions on Prepared Statements in Java. Is it beneficial to
am using a Prepared Statement in C#. SqlCommand inscommand = new SqlCommand(supInsert, connection); inscommand.Parameters.Add(@ordQty,
The JDBC 3.0 spec talks about Connection (and Prepared Statement) pooling. We have several
I have to read the below SQL statement from one properties. update scoreconfig set
I have a problem where my prepared statement appears to only be returning the
I am trying out prepared statements, but the below code is not working. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.