Foreign keys aren't working

mlslearn.ga

I can’t create foreign keys in infinity free databases. I am sure that the syntax are correct as they are working on my local server.

Test INT NOT NULL,
FOREIGN KEY (Test) REFRANCES Table_name (refered key)

What charset are you using for your database?

Foreign keys should just work.

Why aren’t you able to create the foreign key? What do you see when you try to create it?

And could you please share the name of the database you’re trying to add this key to and the code (PHP or SQL) you’re using to try to add it?

The more information you can provide about what you’re doing and what’s happening, the better we’re able to help you.

4 Likes

PHP and SQL

utf8mb4_unicode_ci

That tells me nothing. PHP and SQL are how you use databases. I’m not sure which of the multiple questions I asked you’re trying to answer with that, but it doesn’t answer the question.

Again, we need details to help you. No information means no help. And if you can’t be bothered, then please just ignore this topic, because if the issue isn’t important enough for you to describe, then it’s definitely not important enough for us to fix.

5 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.