# MySQL joins and linking tables

**URL:** https://forum.kirupa.com/t/mysql-joins-and-linking-tables/252967
**Category:** programming
**Created:** [February 25, 2008, 10:47pm UTC](https://forum.kirupa.com/t/mysql-joins-and-linking-tables/252967 "2008-02-25T22:47:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 25, 2008, 10:47pm UTC](https://forum.kirupa.com/t/mysql-joins-and-linking-tables/252967/1 "2008-02-25T22:47:09Z")

</div>

Hello all.

I hope someone can help me out with this challenge.

I have three tables in my database

one called

```php
cms_packages

```

another called

```php
cms_features

```

and a linking table called

```php
cms_package_features

```

the table structures look like this

```php

cms_package
>package_id (pk)
>package_title
>package_dscpn

cms_feature
>feature_id (pk)
>feature_title
>feature_dscpn

cms_package_feature
>package_id (fk)
>fetaure_id (fk)

```

Now i can never get my head round this always seem to come unstuck.

What i want to do is list all the packages with the features including the features that package hasn’t got.

so i can end up with a table looking like this.

```php

packages --> (running along top)
feature 1 |x|x|x|x|o|
feature 2 |x|x|o|x|x|
feature 3 |x|x|o|x|x|
feature 4 |x|o|o|x|x|
feature 5 |x|x|o|o|x|

```

Now from what i gather i’m supposed to be using left joins but i can’t for the life of me get it to look like my example.

Can anyone help please?
