
Validate Username & Email in Next.js + MySQL | Prevent Duplicate Registration with Drizzle ORM
In this video, we’ll learn how to validate username and email during registration in our Job Portal App built with Next.js, MySQL, and Drizzle ORM.
We’ll check if the email or username already exists in the database and prevent duplicate registration.
This is an essential step for data validation and user authentication systems in any real-world project.
👉 What You’ll Learn:
How to check if an email already exists in the database
How to verify username duplication
Using Drizzle ORM with OR operator to check multiple conditions
Displaying error messages for existing users
Writing clean and secure server-side validation logic
----------------------------------------------------------------------------------
📂 Source Code
👉 GitHub Repo: https://github.com/thapatechnical/job-portal-nextjs
------------------------------------------------------------------------------------
🔗 Useful Playlists
📘 Next.js Full Stack Playlist:
https://youtube.com/playlist?list=PLwGdqUZWnOp0lwvSBaIzzgV9X0ZiZ-42O&si=aQ_TNBNNx5L7V_bn
⚛️ React.js Playlist:
https://youtube.com/playlist?list=PLwGdqUZWnOp1Rab71vx2zMF6qpwGDB2Z1&si=sDZRxsYNetYmojKd
💻 TypeScript Playlist:
https://youtube.com/playlist?list=PLwGdqUZWnOp0xfHQFmlL52b_6-QZ0mnk_&si=c4jfsd5ElDC1p0A5
------------------------------------------------------------------------------------
💸 Get All My YouTube Videos' Source Code for just ₹199! Grab Now - https://thapatechnical.shop/source-code
📺 Watch the complete Node.JS Playlist here :https://youtube.com/playlist?list=PLwGdqUZWnOp3KELplHtc-RnJ5xTUPqdgH&si=_ob8F88HYxCdspup
🔥 Access Source Code, PPT & Notes here for Free : https://www.thapatechnical.com/2024/11/introduction-to-nodejs.html
------------------------------------------------------------------------
🚀 Boost Your Skills with these Pre-Requisite Videos:
🔗 Best HTML Course - https://youtu.be/5ccq_nLHneE
🔗 Best CSS Course - https://youtu.be/MSICFljRcb4
🔗 JavaScript Basics Course Part 1 - https://youtu.be/13gLB6hDHR8
🔗 JavaScript Advanced Course Part 2 - https://youtu.be/YwsOCN8woA8
------------------------------------------------------------------------
💸 Build Your Own E-commerce Website for Free! - https://www.thapatechnical.com/2024/03/build-complete-ecommerce-website-using.html
------------------------------------------------------------------------
✌️ Join Us!
🚀 Become a Member: Unlock perks, free source code, and more Join Now : https://www.youtube.com/channel/UCwfaAHy4zQUb2APNOGXUCCA/join
📷 Connect on Instagram: https://www.instagram.com/thapatechnical
🗨️ Join Our Discord Server: Hang out with fellow programmers Discord Link: https://discord.gg/MdScmCsua6
------------------------------------------------------------------------
⌛TIMELINE⏳
0:00 USERNAME AND EMAIL WHILE REGISTRATION MUST BE UNIQUE
0:50 WHAT WE WANT - PREVENT DUPLICATE DATA
1:40 Try Yourself - Verify the Process
2:30 How to Check if Email Already Exists
4:40 Add Username Existence Check
5:45 Using OR Operator of Drizzle to Check Multiple Conditions
7:10 Checking if Email Matches
7:50 Same Check for Username
8:20 Test the Registration Functionality
10:00 Clearing Doubts
11:05 Next Video Update
