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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:59:43+00:00 2026-06-09T12:59:43+00:00

I’m trying to update a row in mysql using PDO to do so, i

  • 0

I’m trying to update a row in mysql using PDO to do so, i have no idea why it doesn’t execute. Everything seems to be correct, but it doesn’t execute, neither does it generates any error.

First i get the values that i send via $.ajax

$idRequest = $_POST['idRequest'];
$dateStarted = $_POST['dateStarted'];
$requester = $_POST['requester'];
$quantity = $_POST['quantity'];
$qaauthorization = $_POST['qaauthorization'];
$qengineer = $_POST['qengineer'];
$performer = $_POST['performer'];
$voltage = $_POST['voltage'];
$goal = $_POST['goal'];
$measurementunit = $_POST['measurementunit'];
$account = $_POST['account'];
$centercost = $_POST['centercost'];
$ela = $_POST['ela'];
$it = $_POST['it'];
$testtype = $_POST['testtype'];
$brand = $_POST['brand'];
$model = $_POST['model'];
$part = $_POST['part'];
$objective = $_POST['objective'];
$production = $_POST['production'];
$reason = $_POST['reason'];
$specifications = $_POST['specifications'];

Then i create the query

 $queryRQ = "UPDATE
                request
            SET
                `idRequester` = ? , `idQEngineer` = ? , `RequestDate` = ? , `idModelNumber` = ?,`idPartDescription` = ? ,`idTestType` = ? , `ReasonForTesting` = ? ,
                `Quantity` =?,`Goal` = ?,`idMeasurementUnit` = ?, `Voltage` = ?, `AccountNumber` = ?, `CenterCost` = ?, `ELA` = ?,`ITNumber` = ?, `idPerformer` = ?, `DateStarted` = NOW(), `DateCompleted` = NULL,
                `Specifications` =?, `idObjective` = ?, `idProduction` = ?, `idBrand` = ?, `Available` = 1 , `Pending` = 0)
            WHERE
                idRequest = ?";

Finally when i prepare and execute the $stmt it seems as if nothing has happened, and it doesn’t generate any error

$reqVals = array($requester,$qengineer,$dateStarted,$model,$part,$testtype,$reason,
                    $quantity,$goal,$measurementunit,$voltage,$account,$centercost,$ela,$it,$performer,
                    $specifications,$objective,$production,$brand, /* WHERE */ $idRequest);
$stmtRQ = $pdo->prepare($queryRQ);
$stmtRQ->execute($reqVals);

I’m reporting the error by surrounding everything with a try - catch:

try{
 // EVERYTHING
} catch(PDOException $e){
    echo(json_encode($e->getMessage());
}
  • 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-09T12:59:45+00:00Added an answer on June 9, 2026 at 12:59 pm

    You have an extra NULL keyword which looks out of place…

    `DateStarted` = NOW(), NULL,
                           ^^^^^
    

    There’s also a right paren that looks invalid …

     `Pending` = 0)
                  ^
    

    For spotting these kinds of things, formatting SQL statements in a particular way (even if it is more lines) helps a lot… here’s a malformed SQL statement that is equivalent to yours, it has the extraneous NULL keyword, and the unmatched closing (right) paren:

    UPDATE request
       SET `idRequester`       = ?
         , `idQEngineer`       = ?
         , `RequestDate`       = ?
         , `idModelNumber`     = ?
         , `idPartDescription` = ?
         , `idTestType`        = ?
         , `ReasonForTesting`  = ?
         , `Quantity`          = ?
         , `Goal`              = ?
         , `idMeasurementUnit` = ?
         , `Voltage`           = ?
         , `AccountNumber`     = ?
         , `CenterCost`        = ?
         , `ELA`               = ?
         , `ITNumber`          = ?
         , `idPerformer`       = ?
         , `DateStarted`       = NOW()
         , NULL
         , `Specifications`    = ?
         , `idObjective`       = ?
         , `idProduction`      = ?
         , `idBrand`           = ?
         , `Available`         = 1
         , `Pending`           = 0
         )
     WHERE idRequest = ?
    

    If this SQL statement is being sent to the database, the database is certainly raising an exception. The more fundamental problem is that your code is either not preparing this statement, or it’s not exposing a SQL exception in the way you expect it to.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what 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.