1

I'm wanting to use the RedBeanPHP ORM tool with an existing WordPress setup. But WordPress uses the column name of 'ID' (in capital letters) and RedBeanPHP enforces the column name of 'id' (all lowercase) for the primary key column of tables.

Because WordPress uses MySQL and because MySQL honors the case of it's column names it is not possible add another column, 'id', to the tables and set a trigger to update the new column.

The recent 3.0 series of RedBeanPHP has taken out all of the code that enabled users to retrofit it to already existing DBs. Everything should work fine.

[Edit]:

Although this seems like a duplicate question - it is slightly (and to me - importantly) different. I wondered if there was an obvious means of using the existing 'ID' column although the case is wrong. This is a challenge for anyone wanting to use RedBeanPHP together with WordPress.

jester66
  • 242
  • 2
  • 10
  • According to the author of RedBeanPHP there is a simple solution - to use a VIEW on the table. I have tested this approach and it works perfectly. Since my asking the question, he has added this solution to the FAQ. – jester66 Oct 16 '13 at 08:34
  • Here is the email from Gabor: https://groups.google.com/forum/#!searchin/redbeanorm/view/redbeanorm/wXUeT4Tj2uU/3AngnmVwZdYJ – jester66 Oct 26 '13 at 21:02

0 Answers0