I am running a application using codeigniter framework. I have a database. I want to implement datamapper ORM. Since for datamapper- "Every table must have a primary key named id".
I have an auto increment integer field in all tables. But the column name is not "id" in all cases. In my user
table, the auto-increment integer column name is user_id
instead of id
. What changes do i need to make to work with Datamapper ?
A Database Error Occurred
Error Number: 1054
Unknown column 'id' in 'where clause'
SELECT *
FROM (`user`)
WHERE `id` = 200
Filename: D:\Projects\DealVector\dealvector\system\database\DB_driver.php
Line Number: 330