# Accessing data from another table

**URL:** <https://discourse.cakephp.org/t/accessing-data-from-another-table/5502>\
**Category:** Need Help\
**Created:** [January 9, 2019, 3:47am UTC](https://discourse.cakephp.org/t/accessing-data-from-another-table/5502 "2019-01-09T03:47:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johndavepaclar](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@johndavepaclar](https://discourse.cakephp.org/u/johndavepaclar)\
**Post date:** [January 9, 2019, 3:47am UTC](https://discourse.cakephp.org/t/accessing-data-from-another-table/5502/1 "2019-01-09T03:47:36Z")

</div>

Hello everyone, i’m doing an Information system for fun and im still new with the framework. I want to access a data from another table in the database. Im doing this for privilege reasons.

In the photo is my ERD, i want to access the position\_id from the position table in my users table.

echo $this-\>Auth-\>User(‘position\_id’) doesnt work apparently.

PS: Disregard the naming conventions, i promise that the naming conventions in my database is correct. 🙂  
 ![Capture](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex029/uploads/cakephp/original/2X/1/1cfc5b5746908314c6a6e44e327456d48e25acc2.png)

---

<div class="post-metadata">

**Author:** ![sathishcake](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@sathishcake](https://discourse.cakephp.org/u/sathishcake)\
**Post date:** [January 10, 2019, 5:57am UTC](https://discourse.cakephp.org/t/accessing-data-from-another-table/5502/2 "2019-01-10T05:57:54Z")

</div>

Check cakephp ORM [Cakephp3 ORM](https://book.cakephp.org/3.0/en/orm.html) . You can get some idea to do that.
