Click here to Skip to main content
16,022,362 members

Comments by Member 16279690 (Top 2 by date)

Member 16279690 9-Jun-24 4:52am View    
Seems like didn't work from my end :( Not sure if I was getting error code 1062 cause when I inspect the browser, it only shows have 1 issue
The script is like this:
// Finally add to registration table
$stmt = mysqli_prepare($connection, "INSERT INTO tblapplication (no_file,no_file_md,no_file_ptj,client_name,client_phone,client_email,ptj_id,status) VALUES (?,?,?,?,?,
(SELECT tblptj.ptj_id FROM tblptj WHERE tblptj.reg_date=? AND tblptj.pass_date=? AND tblptj.ljt_pay=? AND tblptj.ljt_certificate=? AND tblptj.qt_reg=? AND tblptj.qt_pass=?),?);");

mysqli_stmt_bind_param($stmt, 'sssssssssssss', $_POST["no_file"],$_POST["no_file_md"],$_POST["no_file_ptj"],$_POST["client_name"],$_POST["client_phone"],$_POST["client_email"]
,$_POST["reg_date"],$_POST["pass_date"],$_POST["ljt_pay"],$_POST["ljt_certificate"],$_POST["qt_reg"],$_POST["qt_pass"]
,$_POST["status"]);
/* execute prepared statement */
mysqli_stmt_execute($stmt);

/* close statement and connection */
mysqli_stmt_close($stmt);

if (mysqli_error() == 1062){
$msg = "
  Please check your email!
";
}

The form is still using onsubmit function which check the dates. For email or any unique column, not sure how to execute the error
Member 16279690 9-Jun-24 4:24am View    
I am using MySQL database. Not sure if MySQL can execute error if the value is duplicate. If I put the duplicate value on the unique column on the form, after clicking the submit button, the page return blank. I'm still newbie on this