CountryGirl Posted March 28, 2010 Share Posted March 28, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/196813-foreign-keys-myisam-possible-or-not/ Share on other sites More sharing options...
premiso Posted March 28, 2010 Share Posted March 28, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/196813-foreign-keys-myisam-possible-or-not/#findComment-1033171 Share on other sites More sharing options...
CountryGirl Posted March 28, 2010 Author Share Posted March 28, 2010 Okay, is there any site or tutorial on that, since I'm no pro at PHP/MySQL at the moment . Thanks! I'll take a look at the PHP Doctrine link you sent too. Quote Link to comment https://forums.phpfreaks.com/topic/196813-foreign-keys-myisam-possible-or-not/#findComment-1033210 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.