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 9266505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:20:05+00:00 2026-06-18T14:20:05+00:00

ok, this is my codes to bind the parameters dynamically. $sql = INSERT INTO

  • 0

ok, this is my codes to bind the parameters dynamically.

$sql = "INSERT INTO `users` (`name`, `password`, `email`, `permission`) VALUES (?, ?, ?, ?)";
$sql_stmt =  $mysqli->prepare ($sql);

$test = array("ssss","1","2","3","4");

call_user_func_array(array($sql_stmt,'bind_param') ,$test);

$sql_stmt->execute();

I get a “No data supplied for parameters in prepared statement” error. However, the following line will work.

call_user_func_array(array($sql_stmt,'bind_param') ,array("ssss","1","2","3","4"));

I have no idea what is going on here.

edit
I just tried doing a

echo $sql_stmt->param_count;

and I get a proper count of 4.

It will be of great help if I can be enlightened on this.

Thank you.

  • 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-18T14:20:06+00:00Added an answer on June 18, 2026 at 2:20 pm

    Read the second note in PHP’s page for bind_param. It says call_user_func_array() needs parameters to be passed by reference. So this should work:

    $arr = array('ssss', '1', '2', '3', '4');
    call_user_func_array( array($sql_stmt, 'bind_param'), &$arr );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this code: new Ajax.Request('?service=example', { parameters : {tags : 'exceptions'}, onSuccess : this.dataReceived.bind(this)
I'm trying to dynamically bind mysql_stmt parameters and get the result in an associative
Possible Duplicate: Dynamically bind mysqli_stmt parameters and then bind result (PHP) can any one
I am using this code: $('.ui-accordion').bind('accordionchange', function(event, ui) { $(this).next().next().css({'background-image':'images/green-bg.jpg'}); //ui.newHeader // jQuery object,
When I run this code: import javax.xml.bind.JAXBContext; import javax.xml.bind.Marshaller; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import
I am using this code to display a grid $('#table1 tr').bind('click', shows); function shows()
I am using this bit of code successfully: $(window).bind('resize',function() { window.location.href = window.location.href; });
I have a code like this $(document).ready(function(){ $(.add).bind ('click', function () { $('.main').append('<div class=add>Add
I have this kind of code below, how can I bind the visibility of
I've the following code: $.each(css, function(i, v) { css[i] = this.replace('{bind}', bindName, css[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.