-3

I have the following code to access my table STDEMK:

$dbh = new PDO($dsn, $dbuser, $dbpassword, array(PDO::ATTR_PERSISTENT => true));
$sqldel = $dbh->prepare('DELETE FROM STDEMK WHERE CLIENT = :CLIENT AND TRNEID = :TRNEID AND CRSNUM = :CRSNUM AND SEMCD = :SEMCD AND SUBCD = :SUBCD');

$sqldel->bindParam(':CLIENT', $im_client, PDO::PARAM_STR);
$sqldel->bindParam(':TRNEID', $im_trneid, PDO::PARAM_STR);
$sqldel->bindParam(':CRSNUM', $im_crsnum, PDO::PARAM_STR);
$sqldel->bindParam(':SEMCD',  $im_semcd,  PDO::PARAM_STR);
$sqldel->bindValue(':SUBCD',  $im_subcd,  PDO::PARAM_STR);
$sqldel->execute();

but does not work. please let me know if I have any error/s above.

pb2q
  • 58,613
  • 19
  • 146
  • 147

1 Answers1

1

check out this page: http://php.net/manual/en/pdo.error-handling.php I usually set error mode to exception and control errors using try/catch block.

as it;s written in the above link, by default, error mode is on silence and your have to check it out by yourself using desire methods which is defined and mentioned in above link.