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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:13:39+00:00 2026-06-14T21:13:39+00:00

I am trying to update 2 different tables using a transaction. For my first

  • 0

I am trying to update 2 different tables using a transaction. For my first query I get the error “No data supplied for parameters in prepared statement”. my second query goes through just fine. I know that the error refers to the variables being passed to the $stmt->bind_param(). I have checked, triple checked and can confirm that all the vars that I am passing to it actually contain values. I have also checked to make sure the value being passed is correctly indicated by an ‘s’ or an ‘i’. My question is do I have a syntax error that would give me this error message or is there any other suggestion as to how I can fix it?

function updateClient($id,$first,$last,$email,$phone,$phoneCarrier,$tz,$wdh1,$wdh2,$weh1,$weh2,$goals){
global $conguest;
global $database;

$conguest->autocommit(false);  

//update the client tabel
$sql="UPDATE $database.client SET clientFirst = '?', clientLast = '?', clientEmail ='?', clientPhone =?, phoneCarrierId =?, timezoneId =?, clientHour1 ='?',clientHour2 ='?',clientHour3 ='?',clientHour4 ='?'
WHERE clientId = ?";

if($stmt = $conguest->prepare($sql)){        
    $stmt->bind_param('ssssiissssi', $first, $last, $email, $phone, $phoneCarrier, $tz, $wdh1, $wdh2, $weh1, $weh2, $id);
    $stmt->execute();        
    $clientupdate = $stmt->affected_rows;        
    $stmt->close();
}   
//update the goals table
$sql = "UPDATE $database.goal SET goalContent=?, categoryId = ?, goalDate=now() WHERE goalId = ?";

foreach ($goals as $goal) {
    if ($stmt = $conguest->prepare($sql)) {
        $stmt->bind_param('sii', $goal['goal'],$goal['cat'], $goal['id']);
        $stmt->execute();
        $i = $stmt->affected_rows;
        $stmt->close();
    }
    if($i){
        $goalupdate ++;
    }
}
//test that all updates worked
echo "$clientupdate, $goalupdate";
exit;
if($clientupdate ==1 && $goalupdate == 3){
    $conguest->commit();
    $conguest->autocommit(true);
    return 1;
}else{
    $conguest->rollback();
    $conguest->autocommit(true);
    return 0;
}    

}

  • 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-14T21:13:40+00:00Added an answer on June 14, 2026 at 9:13 pm

    Remove the single quotes around your placeholders. Replace

    $sql="UPDATE $database.client SET clientFirst = '?', clientLast = '?', clientEmail ='?', clientPhone =?, phoneCarrierId =?, timezoneId =?, clientHour1 ='?',clientHour2 ='?',clientHour3 ='?',clientHour4 ='?' WHERE clientId = ?";
    

    with

    $sql="UPDATE $database.client SET clientFirst = ?, clientLast = ?, clientEmail = ?, clientPhone = ?, phoneCarrierId = ?, timezoneId = ?, clientHour1 = ?, clientHour2 = ?,clientHour3 = ?,clientHour4 = ? WHERE clientId = ?";
    

    Furthermore, there’s a newline before “where clientid”. I don’t know whether this is relevant.

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

Sidebar

Related Questions

I'm trying to update values using JDBC and I continue to get the same
I'm trying to get some aggregate values from different tables, but my problem is
I'm trying to update row in a table using values from a different row
When trying to update a subversion working copy from Netbeans, I get the following
Another utf-8 related problem I believe... I am using php to update data in
I have 3 tables which contain different types of data related to each other.
I'm using jQuery Tablesorter with Zebra widget on multiple tables. What i'm trying to
I am stuck on an update query that is using a subquery and have
I am trying to import data from a large database. I have two tables
I'm using two tables for my current project(it will grow certainly). First table has

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.