I am just learning PHP for fun and am trying to join and display info from three tables.
Three tables are set like this
Code:
Client 
     clientId
     firstName 
     lastName
     phone
     email

dog
     dogId
     name
     behavior
     sex
     age

appointments
     appointmentId
     dogId
     clientId
     start
     month 
     day
     year
I'm wanting to make like a day at a glance type deal, on my main admin page. And am trying to pull the info like this

PHP Code:
include("include/config.php");
date_default_timezone_set('America/Denver');
    
$m date("m");
    
$d date("d");
    
$y date("Y");
$result mysql_query("SELECT client.lastName, dog.name, appointments.start FROM appointments INNER JOIN client ON appointments.clientId = client.clientId INNER JOIN dog ON appointments.dogId = dog.dogId WHERE appointments.mounth= $m AND appointments.day = $d AND appointments.year = $y ORDER BY apointments.start ASC");
$num_rows mysql_num_rows($result);
    if(
$num_rows == "0") {
 echo 
"$num_rows appointments scheduled for today.<br />";
 }
    elseif(
$num_rows == "1"){
    echo 
"$num_rows appointment scheduled for today.<br />";
    }
    else{
    echo 
"$num_rows appointments scheduled for today.<br />";
    }
    
        if(
$num_rows "0") {
        
        echo 
'<table width="400">
                <tr><th>Client</th><th>Dog</th><th>Start</th><th>Select</th></tr>'
;
        while(
$row mysql_fetch_array($result)){
        echo 
'<tr><td>' $row['lastName'] .     '</td><td>' $row['name'] . '</td><td>' $row['start'] . '</td><td><a href="viewappointment.php?id=' $row['appointmentId'] . '">View</a></td></tr>';
        
        
        }
        echo 
'</table>';
        } 
Any help would be awesome. Thanks.