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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:53:38+00:00 2026-05-27T10:53:38+00:00

I am trying to update a record from a php script if the checkbox

  • 0

I am trying to update a record from a php script if the checkbox pendinginput_c is selected. I cannot get the record to update from the script. However if I type the exact command below in the mysql console then the record updates correctly.

                if($bean->pendinginput_c == 'on')
            {
            $sql = "UPDATE cases SET status='Pending Input' WHERE id='958ca4e5-51'";
            }   

Further up in the script you will see there are other sql statements that are currently working. No updates, just selects.

$sql_nmb = "SELECT case_number FROM cases where id='".$bean->parent_id."'";
            $result = $bean->db->query($sql_nmb, true);
            $case = $bean->db->fetchByAssoc($result);               

            $sql = 'SELECT c.assigned_user_id , c.id , cc.contact_id as contact_id, co.first_name , co.last_name , ear.email_address_id ,ea.email_address FROM cases as c 
                        LEFT JOIN contacts_cases as cc on c.id = cc.case_id
                        LEFT JOIN contacts as co on co.id = contact_id
                        LEFT JOIN email_addr_bean_rel ear ON ear.bean_id = contact_id
                        LEFT JOIN email_addresses as ea on ea.id = ear.email_address_id
                        WHERE c.id = "'.$bean->parent_id.'" and cc.deleted = 0 and ear.deleted = 0 and ea.deleted = 0';
            $resp = $bean->db->query($sql, true); 
  • 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-27T10:53:39+00:00Added an answer on May 27, 2026 at 10:53 am

    Try this:

    if($bean->pendinginput_c == 'on'){
        $sql = "UPDATE cases SET status='Pending Input' WHERE id='958ca4e5-51'";
        $bean->db->query($sql, true); 
    }
    

    Additionally check that $bean->pendinginput_c really equals “on”. echo it above the if statement to double check.

    Good luck!

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

Sidebar

Related Questions

I'm trying to return a record from LINQ2SQL as a JsonResult to update my
I am trying to update a record from an index using either jQuery alone
I am trying to make a script in PHP that finds if the update
I'm trying to get php to update a MySQL table using UPDATE statement but
I am trying to update a field in a table with data from another
I am trying to update a field of type spFieldUserValue, you know a, PeoplePicker.
Im a php/mySQL newbie and am trying to get the hang of it. I
I'm trying to use the following query syntax from a php file: $sql =
I'm trying to delete a record from Gridview1 at the same time delete the
I get a mysql error: #update (ActiveRecord::StatementInvalid) Mysql::Error: #HY000Got error 139 from storage engine:

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.