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

  • Home
  • SEARCH
  • 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 3459782
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:08:58+00:00 2026-05-18T10:08:58+00:00

What would cause this? Code follows: $m = new mysqli($host,$user,$pass,$db); if(mysqli_connect_errno()) die(‘Connect failed: ‘

  • 0

What would cause this? Code follows:

$m = new mysqli($host,$user,$pass,$db);
if(mysqli_connect_errno()) die('Connect failed: ' . mysqli_connect_error());
$PrepSQL  = "INSERT INTO Products (" . implode(',',$this->cols) . ") VALUES (";
$PrepSQL .= '?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
$stmt = $m->prepare($PrepSQL);
if(!$stmt) die('Could not prepare: ' . $m->error . "\n$PrepSQL\n");
$ret = $stmt->bind_param('isissssddssssssssssssssssssssssssisssssss',
      $contents[0], ... bunch of these here ... );
if(!$ret) die('bind_param failed: ' . $m->error);

Then in a loop I have:

$contents = explode('|',$NL); // NL is pipe delimited data
print_r($contents); 
if(!$stmt->execute()) die("Statement failed: " . $m->error);

And the script doesn’t halt but every value is null in MySQL. Most of the types are strings and I would assume they would at least fill in even if the numeric types are wrong. The print_r is printing values correctly.

  • 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-05-18T10:08:58+00:00Added an answer on May 18, 2026 at 10:08 am

    Can you show the complete code from preparing the statement to executing it?

    I suspect that $contents in the first part is not the same $contents as in the second part. They need to be references to the same array, since you’re populating it after binding it by reference.

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

Sidebar

Related Questions

What logging library or approach would you recommend for this case: We want to
Is there a way to tell subversion update/merge unless it would cause a conflict?
I have a Guid.NewGuid() call that is creating an Empty Guid. What would cause
I want to pass an event into a method. The code I have is
for (int i=0; i<arr.length; i++) { } This will result in a code: getstatic
I would like to understand the ServiceBehavior.ConcurrencyMode property. Consider the following code on service
I have been unable to determine the cause of this problem, so I can
If I run svnserve.exe alongside Subversion Edge, would it cause any conflicts? We have
I would like to be able to refactor out the OrderBy clause in a
How would I create the equivalent Linq To Objects query? SELECT MIN(CASE WHEN p.type

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.