# Foreign keys in mysql/php

**URL:** <https://forum.kirupa.com/t/foreign-keys-in-mysql-php/203325>\
**Category:** Uncategorized\
**Created:** [October 10, 2006, 7:07am UTC](https://forum.kirupa.com/t/foreign-keys-in-mysql-php/203325 "2006-10-10T07:07:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pucca](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@pucca](https://forum.kirupa.com/u/pucca)\
**Post date:** [October 10, 2006, 7:07am UTC](https://forum.kirupa.com/t/foreign-keys-in-mysql-php/203325/1 "2006-10-10T07:07:26Z")

</div>

Hope you can help me. I’m retreving info from a database from two seperate tables. With foreign keys. Heres my sql :

```php
$list = mysql_query("SELECT * from desta_serviceproviders, desta_towns WHERE province = $Id AND desta_serviceproviders.TownId = desta_towns.Id LIMIT $from,$max_results");

```

So what I’m trying to get… in the table desta\_serviceproviders there’s a field called TownId which is a foreign key of table desta\_towns. When I get the result, it still only shows the letter in the desta\_serviceproviders and not the full name as seen in desta\_towns…

Hope this is clear.

Appreciate…
