Ad

How To Concat Dot(.) To String Like Pic.jpeg In Mysql Triggers?

I am getting this error

Column not found: 1054 Unknown column '.' in 'field list.'

Code:

NEW.student_img_name = CONCAT(NEW.student_roll_no,'.',
                              (SUBSTRING_INDEX(NEW.student_img_name, `.`, -1)))
Ad

Answer

NEW.student_img_name = CONCAT(NEW.student_roll_no,'.',
                             (SUBSTRING_INDEX(NEW.student_img_name, '.', -1)))

Try this? Maybe the error showing up is not the First dot, but the second one in SUBSTRING_INDEX.

Ad
source: stackoverflow.com
Ad