Im following a tutorial at the moment and learning how to build something into my existing site.
The tutorial tells me that i need to run this against my database
ALTER TABLE posts ADD FOREIGN KEY(post_by) REFERENCES users(user_id) ON DELETE RESTRICT ON UPDATE CASCADE;
and im receiving an error saying it cant create table.
the ‘users’ table is from my existing database and everything else is new.
The tutorial gives me a few alter commands to run and they all go perfect, except when im trying to use the ‘users’ table.
Im totally stuck on this, any help would be greatly appreciated.
Cheers
Check your table type. It should be
InnoDB.