Jump to content

Recommended Posts

I'm trying to make my database layout more organized and therefore am making it a relational database. I need foreign keys to be able to do so, from what I understand. At the moment my database type is MyISAM, but foreign keys aren't available in MyISAM. So, I need InnoDB. The web hosting company for the website I’m working on says their server does not support an InnoDB type.

 

At the moment, my database format is MyISAM. I know how to change the database format. Is there a way to use something in MyISAM as the foreign keys? Like apply a Unique key to a table. Or, do I have to use an InnoDB type?

 

This isn’t the first time the company has claimed their server doesn’t support something with PHP/MySQL. So, if I push hard enough I might be able to get around this, as I have been able to do before ;). But, I thought I’d see if there’s a way that I could do this without using InnoDB.

 

Thanks for any tips/info!

Qadoshyah

 

Link to comment
https://forums.phpfreaks.com/topic/196813-foreign-keys-myisam-possible-or-not/
Share on other sites

You can use foreign keys concept, that is not a problem at all. You just have to do the relationships manually and just make sure you cascade the deletes / updates etc.

 

If you want to, you can probably even implement PHP Doctrine which will setup all that for you given the schema's etc. Once you learn how it works that is. The main feature you miss out with the MyISAM vs InnoDB is the Transactions. So yea. The logic should work fine.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.