is there a way to check " if data is inserted " in case of "UNIQUE" field?
<?php require_once('../Connections/wa_cnx.php'); ?>
<?php require_once('../webassist/mysqli/queryobj.php'); ?>
<?php
if ("" == "") {
$InsertQuery = new WA_MySQLi_Query($wa_cnx);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "list_select";
$InsertQuery->bindColumn("ls_label", "s", "xyz", "WA_DEFAULT");
$InsertQuery->saveInSession("");
$InsertQuery->execute();
$InsertGoTo = "";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
$InsertQuery->redirect($InsertGoTo);
}
?>
In the above example (insert on page load .i.e.: before page load) : page gets executed in-dependent of what happens to INSERT query.
there is no possibility to check whether " record is INSERTED" or " NOT "
FOR INSTANCE:
if the field " ls_label " is UNIQUE and same value is already present in the field, 'THIS page simply gets executed " and doesn't give a clue about " DUPLICATE Entry " i.e. " 1062 - Duplicate entry "
In fact if the field already has the same value, it should have been generating " a Duplicate Entry " error????
Can someone please help me? solve this issue ??
Thank you in advance,
Sin