# SQLSTATE\[42S22\]: Column not found: 1054 Unknown column 'people.id' in 'on clause'

**URL:** <https://discourse.cakephp.org/t/sqlstate-42s22-column-not-found-1054-unknown-column-people-id-in-on-clause/10113>\
**Category:** Uncategorized\
**Created:** [January 25, 2022, 1:18pm UTC](https://discourse.cakephp.org/t/sqlstate-42s22-column-not-found-1054-unknown-column-people-id-in-on-clause/10113 "2022-01-25T13:18:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![user\_looser](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/user_looser/32/2161_2.png) [@user\_looser](https://discourse.cakephp.org/u/user_looser)\
**Post date:** [January 25, 2022, 1:18pm UTC](https://discourse.cakephp.org/t/sqlstate-42s22-column-not-found-1054-unknown-column-people-id-in-on-clause/10113/1 "2022-01-25T13:18:08Z")

</div>

Hi everybody, may I ask you for a help?

When I run my page on local WAMP Win10 installation, the page displays what it should:

 ![view subject production](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/2/28c5f24c574a9662885b167526eb04b5a415e685.png)

When I run the same page on my commercial hosting, I get error:

 ![error](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/1/18adbef28dbfce91f7702f3ab2eb6bc0942b6a89.png)

I tired to do some debugging and on loal, as well as production server, following SQL string is generated by CakePHP:

SELECT DISTINCT `People`.`id` AS `People __id`, `People`.`title1` AS `People__ title1`, `People`.`name` AS `People __name`, `People`.`surname` AS `People__ surname`, `People`.`title2` AS `People __title2`, `People`.`street` AS `People__ street`, `People`.`city` AS `People __city`, `People`.`zip` AS `People__ zip`, `People`.`country_id` AS `People __country_id`, `People`.`email` AS `People__ email`, `People`.`contact` AS `People__contact` FROM `people` `People` INNER JOIN `direps_rulings` `dirrul` ON People.id = dirrul.direp\_id INNER JOIN `rulings` `rul` ON dirrul.ruling\_id = rul.id WHERE `rul`.`subject_id` = 1

When I run the string on production server via phpMyAdmin, it simply works:

 ![phpmyadmin](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/0/076526b1fc10bd76043af63fc77c3c2bb0cbe37c.png)

When I display a person with people.id via PeopleController on production server, it works.

 ![person1 production](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/0/0dbf7351323fd93d6646cfe35f33945f41c483af.png)

Does anybody can advice me, why it does not work for my join query? The column people.id certainly exists, otherwise I would not be able to display person with id=1 using the PeopleController and its View action …

 ![controller_code](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/9/9d65a48bc5d67e7d2fd6de7d8181802b1a179d67.png)

Thank you very much!

---

<div class="post-metadata">

**Author:** ![user\_looser](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/user_looser/32/2161_2.png) [@user\_looser](https://discourse.cakephp.org/u/user_looser)\
**Post date:** [January 25, 2022, 1:28pm UTC](https://discourse.cakephp.org/t/sqlstate-42s22-column-not-found-1054-unknown-column-people-id-in-on-clause/10113/2 "2022-01-25T13:28:32Z")

</div>

I am sorry. I got the error. I just changed to uppercase only one table name, I forgot to change it on anoher row within the code.

 ![fin](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/4/481a59b78ef70fc1de38166d6d6a78b50e0d467d.png)
