close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

is there a way to check " if data is inserted " in case of "UNIQUE" field?

Thread began 10/08/2015 9:56 pm by Sing | Last modified 10/12/2015 2:23 pm by Sing | 622 views | 2 replies


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'); ?>
if ("" == "") {
$InsertQuery = new WA_MySQLi_Query($wa_cnx);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "list_select";
$InsertQuery->bindColumn("ls_label", "s", "xyz", "WA_DEFAULT");
$InsertGoTo = "";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";

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 "

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,

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...