php - MYSQL INNER JOINS -
i have 2 tables in database. 1 used booking selection of dates , times available , other used returning selection of dates , times available. need link these 2 on 1 page. <?php { mysql_connect("localhost" , "" , "") or die (mysql_error()); mysql_select_db("") or die(mysql_error()); $pid=intval($_session["user_id"]); $query = "select t1.*, t2.return_time, t2.return_date returnout t1 inner join return t2 on t1.book_time=t2.book_time"; //executes query on database $result = mysql_query ($query) or die ("didn't query"); //this selects results rows $num = mysql_num_rows ($result); $dates_and_times = array(); while($row=mysql_fetch_assoc($result)) { $dates_and_times[] = $row['book_date'].' '.$row['book_time']; $dates_and_times[] = $row['return_date'].' '.$row['retun_time']; } } ?>