0
I have my event schedule (tbl_eventos
), where I am going to find the id_contact field of the contacts table (tbl_contactos
). To create this link, I used the following:
ALTER TABLE `tbl_eventos`
ADD CONSTRAINT `tbl_eventos_ibfk_3` FOREIGN KEY (`id_contacto`) REFERENCES `tbl_contactos` (`id_contacto`);
What happens now is that my contact table has changed its name, which means it’s gone from tbl_contactos
for tbl_contactos_cliente
. How can I make this change? The code above was generated by phpmyadmin.
You can’t just drop and create again?
– Pedro Lorentz
@Pedrolorentz, that’s not what I wanted. But if I can’t find another solution, it will have to be. Thanks anyway.
– pc_oc
I’m not going to put it as an answer for now so I can instigate more people to come here and give them another choice.
– Pedro Lorentz
I believe the solution of @Pedrolorentz is the most suitable as it is simple, widely used and safe.
– EduardoFernandes