I am inserting data to a MySQL DB, In case if the insertion fails i need to give an appropriate error message indicating so. According to my code below i will be Echo-
Echo-
After INSERT query you can use ROW_COUNT() to check for successful insert operation as:
INSERT
ROW_COUNT()
SELECT IF(ROW_COUNT() = 1, "Insert Success", "Insert Failed") As status;