mysqlの行を更新しようとしPDO
ていますが、なぜ実行されないのかわかりません。すべてが正しいように見えますが、実行されず、エラーも生成されません。
まず、送信した値を取得します$.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'];
次に、クエリを作成します
$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 = ?";
最後に、私prepare
とそれが何も起こらなかったかのように見え、エラーが発生しないexecute
場合$stmt
$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);
try - catch
すべてを:で囲んでエラーを報告しています。
try{
// EVERYTHING
} catch(PDOException $e){
echo(json_encode($e->getMessage());
}