Q:

3 table SQL Query

I dont have huge experience with SQL so I'm trying to formulate a query with the following tables:
   TABLE `customerdeal` (
   `id` ,
   `customerid` 
   `dealid` 
   PRIMARY KEY (`id`),
   KEY `dealid` (`dealid`),
   KEY `customerid` (`customerid`),

  TABLE `deal` (
  `dealid`,
  `dname` 
  `description` 
  `restaurantid` 
   PRIMARY KEY (`dealid`),
   KEY `restaurantid` (`restaurantid`)

  TABLE `restaurant` (
  `restaurantid` 
  `name` 
 `username` 
 `password` 
  PRIMARY KEY (`restaurantid`)

Basically the Customerdeal table holds 2 id values - a customerid and a dealid.  I have already successfully created an SQL code which will render the customerid of the logged in user which is being stored in a $_customerid value. 
In plain english what I'm trying to do now create an SQL statement which will:

Get the dealid that are in the same row as the $_customerid values
use said dealid to render the deal info from the deal table under said ids
get the restaurant info hows foreign keys are being held in the selected dealid rows
 - 

I've been back and forth trying different ways but none of them work!  If anyone can help me out I'd appreciate it!  Thanks!  

A:

I'm surprised that you haven't declared any types for any of the columns.  
I am not sure I understand what it is you're trying to do with your query though.  Could you clarify?  You could do something like this:
    select d.dname as dealname, d.description as dealinfo, 
    r.description as restaurantinfo, r.name as restaurant name 
    from deal d, restaurant r, customer c 
    where r.restaurantid = d.restaurantid, d.dealid = c.dealid,
    c.customerid = 'whatever you want'

