j4mie / idiorm

A lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP5.
http://j4mie.github.com/idiormandparis/
2.01k stars 369 forks source link

update issue #112

Closed mrlami closed 11 years ago

mrlami commented 11 years ago

idiorm given below PDO error when trying to update table. (note: table primary key is not labeled 'id', but 'app_id' instead)

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'where clause' (code 42S22)

$user = ORM::for_table('app_users') ->where_raw(" (Name='$email' and Password='$password') or (Email='$email' and Password='$password') ") ->find_one();

$user->Logins = $user->Logins + 1; $user->save();

mrlami commented 11 years ago

Never mind! The solution was to tweak settings to override default ID column.

https://idiorm.readthedocs.org/en/v1.3.0/configuration.html#id-column