16,022,362 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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