lional Posted April 30, 2013 Share Posted April 30, 2013 Hi, I have a site where a client requests to join a particular event. From a management site I would like to list the clients who have requested the events specifying if they have attaended the event before so that new applicants will get preference. My tables are as follows. Clients table - I would like to pull the following filelds: fullnames, idno, tel (each client is assigned an unique client_id Event request - I would like to pull the event ID (The fileds in this table are client_is, event_id) Event_booking_history - I would like to pull the amount of times the client has donae a particular event. (the fileds in this table are clieny_id, event_id, no_of_times) I am trying to pull a list from this tables that would list fullname, tel, idno, no_of_times for a specific event that us selected from a drop-down box. I would like check boxes so that I can select which clients can attend which events. here is my code so far <?php $query_town = "SELECT clients.fullnames, clients.idno, clients.tel, event_request.event_id, event_booking_history.no_of_times FROM clients, event_request, event_booking_history WHERE event_request = '$bucket_list_out'"; $result_town = mysql_query($query_town) OR die(mysql_error()); while ($row_town = mysql_fetch_assoc($result_town)) { $town_out = $row_town["clients.fullnames"]; $town_out = $row_town["clients.idno"]; $town_out = $row_town["clients.tel"]; $town_out = $row_town["event_booking_history.no_of_times"]; ?> Thanks Lional Quote Link to comment Share on other sites More sharing options...
Barand Posted April 30, 2013 Share Posted April 30, 2013 try SELECT clients.fullnames, clients.idno, clients.tel, event_request.event_id, event_booking_history.no_of_times FROM clients INNER JOIN event_request ON clients.idno = event_request.client_id INNER JOIN event_booking_history ON event_booking_history.event_id = event_request.event_id WHERE event_request.event_id = '$bucket_list_out' You cannot have WHERE tablename = 'x', it has to be a columnname or expression (I assumed event_id) Table names are not output with the column names so use $row['idno'] and not $row['clients.idno'] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.