What’s wrong with this SQL statement:
ALTER TABLE `tbl_issue`
ADD CONSTRAINT `FK_issue_requester`
FOREIGN KEY (`requester_id`) REFERENCES `tbl_user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT;
I have tables called tbl_issue and tbl_user within a database called trackstar_dev.
phpMyAdmin said:
#1005 - Can't create table 'trackstar_dev.#sql-1a4_9d' (errno: 121) (<a href="server_engines.php?engine=InnoDB&page=Status&token=fdfsdghrw222323hndgsf">Details...</a>)
The most common reason for this error is that the foreign key constraint have the same name as in another table. Foreign keys’ names must be unique in the database (not just on table level). Do you have
requester_idin another table in your database?