setAttribute(PDO::ATTR_EMULATE_PREPARES, TRUE); $dbh->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); // Escape the value of $author with quote() //$sql = 'SELECT * FROM vsaqtns WHERE sbj = '. $dbh->quote($sbj); //$sql = "UPDATE vsaqtns SET qnatr ='$qnatr', exmtyp ='$exmtyp', dt ='$dt', sbj='$sbj', yr='$yr', questn='$questn', cha='$cha', chb='$chb', chc='$chc', chd='$chd', resp='$resp', soln='$soln', paragraphQ='$pQ', btch='$btch', tps='$tps', qsttus='$qsttus', stMark='$stMark' WHERE pos=". $dbh->quote($Qpos); $sql="UPDATE vsaqtns SET qnatr ='$qnatr', exmtyp ='$exmtyp', dt ='$dt', sbj='$sbj', yr='$yr', questn='$questn', paragT='$paragT', cha='$cha', chb='$chb', chc='$chc', chd='$chd', resp='$resp', soln='$soln', btch='$btch', tps='$tps', qsttus='$qsttus', stMark='$stMark' WHERE pos=". $dbh->quote('$Qpos'); // Execute the statement and echo the results $results = $dbh->query($sql);     // echo a message to say the UPDATE succeeded     //echo $results->rowCount(); //echo $stmt->rowCount() . " records UPDATED successfully"; //echo $results;     } catch(PDOException $e)     {     echo $sql . "
" . $e->getMessage();     } $dbh = null; ?>