RE: [PHP] How to nest information from different tables.

From: Date: Fri, 30 Jul 2004 15:15:38 +0000
Subject: RE: [PHP] How to nest information from different tables.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-192318@lists.php.net to get a copy of this message
John, Since we never have more than 30 records I don't think it will be necessary to join the tables. I tried the following syntax and have one last question. How can I specify that the eventdetails only print the details for the specific record? The first "where" example puts the details after the first loop is completed (code is comments out) The second "where" example put all event_details information in all the events. I must be missing something. TIA //$eventdetails_query = mysql_query("select informations, details, file_name from eventdetails, event where eventdetails.event_id =".$event[0]); $eventdetails_query = mysql_query("select informations, details, file_name from eventdetails, event where eventdetails.event_id = event.id"); while($eventdetails = mysql_fetch_row($eventdetails_query)){ -----Original Message----- From: John Nichel [mailto:john@kegworks.com] Sent: Friday, July 30, 2004 9:52 AM To: php-general@lists.php.net Subject: Re: [PHP] How to nest information from different tables. Karl-Heinz Schulz wrote: > Thank you, > > > I made one error - I forgot the second table (Thank you Jeremy) > It didn't like the field "information" in the eventdetails table - it worked > after I changed it to "informations" (Thank you John). > > > ..........but the result is not what I was trying to achieve. > > I'm trying to display the following > > Event 1 (from event table) > Information (from event table) > Detail (from event table) > File 1 (from event_details table) > File 2 (from event_details table) > File 3 (from event_details table) > > <hr> Check google for information on doing 'Joins' in MySQL. Tracking #: A1D6447851B7E2489F08DDC66F7F0627FB1F13C9 -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#192318) next »