Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9233917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:39:59+00:00 2026-06-18T06:39:59+00:00

I am just creating a trigger for MySQL. But I am getting the below

  • 0

I am just creating a trigger for MySQL. But I am getting the below error.

ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near ‘END’ at line 1

Below is my code to create a trigger.

DROP TRIGGER IF EXISTS user_contact_after_insert;
DELIMITER //
CREATE TRIGGER `user_contact_after_insert`
AFTER INSERT ON `forum_user`
  FOR EACH ROW
  BEGIN
    INSERT INTO `user_contact` (email) VALUES (LCASE(NEW.FIRST_NAME NEW.LAST_NAME+'@gmail.com'));
  END;
DELIMETER ;

Here I have two tables forum_user & user_contact. In forum_user table I have four column like ID, first_name, last_name, Date and in user_contact table I have two columns ID & email.

Now Here I want to create trigger which will insert a row at user_contact table when one row will insert into the forum_user table with the recent value from first_name & last_name.

Am I doing anything wrong in this code.
Any help will be appreciable.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:40:00+00:00Added an answer on June 18, 2026 at 6:40 am

    change the DELIMITER and use CONCAT

    DROP TRIGGER IF EXISTS user_contact_after_insert;
    
    DELIMITER // 
    
    CREATE TRIGGER `user_contact_after_insert` 
    AFTER INSERT ON `forum_user` 
    FOR EACH ROW 
    BEGIN 
        INSERT INTO `user_contact` (email) 
        VALUES (LCASE(CONCAT(NEW.FIRST_NAME, NEW.LAST_NAME,'@gmail.com'))); 
    END//    --- <<=== HERE
    
    DELIMITER ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a trigger in MySQL but have a slight issue. Here's the trigger
I have just finished creating an entire login and register systsem in PHP, but
I have just finished creating an API where the requests from the API are
I have been told to create a trigger for inserts on our SQL Server
How to achieve creating a trigger that ONLY updates if exist but NEVER inserts
I have issues creating this trigger second_loop in sqlite3: It is part of more
This is the closest that I have come to creating a simple trigger on
I'm creating some re-usable functions, and right now I have error handling setup like
I hope I'm not creating a duplicate here, but I just don't really know
I am creating an After Update Trigger on a SQL Server 2008 table. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.