# Connecting to multiple tables in MySQL with one call

**URL:** <https://community.dreamfactory.com/t/connecting-to-multiple-tables-in-mysql-with-one-call/1718>\
**Category:** REST API\
**Created:** [November 5, 2015, 1:34am UTC](https://community.dreamfactory.com/t/connecting-to-multiple-tables-in-mysql-with-one-call/1718 "2015-11-05T01:34:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Omar\_Guzman](https://avatars.discourse-cdn.com/v4/letter/o/bcef8e/32.png) [@Omar\_Guzman](https://community.dreamfactory.com/u/Omar_Guzman)\
**Post date:** [November 5, 2015, 1:34am UTC](https://community.dreamfactory.com/t/connecting-to-multiple-tables-in-mysql-with-one-call/1718/1 "2015-11-05T01:34:46Z")

</div>

Hi! In the previous version I was told that this wasn’t possible but would like to know if it’s possible in the update.  
I would like to make a call to the api and access multiple tables at once. For example my call would go to  
[http://domain.com/api/hit](http://domain.com/api/hit)  
Method : POST  
Calling out different parameters:  
params : {  
‘company\_id’ : company\_id,  
‘order\_id’ : OrderId,  
‘zip’ : Orderzip,  
‘estimated\_age’ :  
and me get back the data but it’s located in different tables in the same db.  
Is this possible?

---

<div class="post-metadata">

**Author:** ![benbusse](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/benbusse/32/4_2.png) [@benbusse](https://community.dreamfactory.com/u/benbusse)\
**Post date:** [November 5, 2015, 1:54am UTC](https://community.dreamfactory.com/t/connecting-to-multiple-tables-in-mysql-with-one-call/1718/2 "2015-11-05T01:54:11Z")

</div>

Use the ‘related’ parameter to query data in multiple tables that are related by foreign key [https://wiki.dreamfactory.com/DreamFactory/Tutorials/Querying\_multiple\_tables\_with\_joins](https://wiki.dreamfactory.com/DreamFactory/Tutorials/Querying_multiple_tables_with_joins).

To query data in more than two tables, you can use stored procedures [https://wiki.dreamfactory.com/DreamFactory/Tutorials/Querying\_stored\_procedures](https://wiki.dreamfactory.com/DreamFactory/Tutorials/Querying_stored_procedures) or you can use server-side scripts.
