I am trying to query two tables that have foreign keys in each other to display conditional results, my tables are as follow:

auction\_bids table:

```
id applicant_id bid auction_id owner.id

```

auctions table:

```
id user_id title description

```

The result I need to display to the logged in user is:

```
title applicant_id [how many bids the project has] auction_id

```

My current not working query is: 

```
SELECT (SELECT COUNT(auction_bids.owner_id)
          FROM auction_bids 
         WHERE auction_bids.owner_id = ".$_SESSION['userid']."
       ) AS count, auction_bids.* 
  FROM auction_bids 
 WHERE auction_bids.owner_id = ".$_SESSION['userid']."

```

i cannot get how many bids each auction has in the database along with the title
Thank you