I tried to get an answer on the PHP mailing list and I was told that this
list would be quicker to get me a solution.
I have two tables "Event" and "Eventdetails" (structures dump can be found
at the end of the message).
I want to display all events and the related information from the
eventdetails table like
Event 1
Details 1 for event 1
Details 2 for event 1
Details 3 for event 1
Event 2
Details 1 for event 2
Details 2 for event 2
Details 3 for event 2
Etc.
I cannot figure it out.
Here is my PHP code.
----------------------------------------------------------------------------
----------------------------------------
<?php
require("../admin/functions.php");
include("../admin/header.inc.php");
?>
<?
$event_query = mysql_query("select id, inserted, information, eventname,
date, title from event order by inserted desc LIMIT 0 , 30");
while($event = mysql_fetch_row($event_query)){
print("<b><span style=\"font-family: Arial, Helvetica,
sans-serif;color:#003300;font-size:14px;\">".html_decode($event[5])."</span>
</b><br>");
print("<span style=\"font-family: Arial, Helvetica,
sans-serif;font-size:12px;\">".html_decode($event[4])."</span><br>");
print("<span style=\"font-family: Arial, Helvetica,
sans-serif;font-size:12px;\">".html_decode($event[2])."</span><p>");
$eventdetail_query = mysql_query("select informations, titles, file_name
from eventdetail, event where eventdetail.event =".$event[0]);
//$eventdetail_query = mysql_query("select titles, informations, file_name
from eventdetail, event where eventdetail.event = event.id");
while($eventdetail = mysql_fetch_row($eventdetail_query)){
print("<span style=\"font-family: Arial, Helvetica,
sans-serif;font-size:12px;\">".html_decode($eventdetail[0])."</span>");
print(" <span style=\"font-family: Arial, Helvetica,
sans-serif;font-size:12px;\">".html_decode($eventdetail[1])."</span>");
print("<span style=\"font-family: Arial, Helvetica,
sans-serif;font-size:12px;\">".html_decode($eventdetail[2])."</span><p>");
}
}
?>
----------------------------------------------------------------------------
----------------------------------------
What am I missing?
TIA
Karl-Heinz
#
# Table structure for table `event`
#
CREATE TABLE event (
id smallint(2) unsigned NOT NULL auto_increment,
veranstaltung smallint(2) unsigned NOT NULL default '0',
inserted date NOT NULL default '0000-00-00',
information text NOT NULL,
eventname text NOT NULL,
date varchar(30) NOT NULL default '',
title varchar(100) NOT NULL default '',
PRIMARY KEY (id)
) TYPE=MyISAM;
#
# Table structure for table `eventdetail`
#
CREATE TABLE eventdetail (
id smallint(2) unsigned NOT NULL auto_increment,
event smallint(2) NOT NULL default '0',
informations text NOT NULL,
titles varchar(100) NOT NULL default '',
file_name varchar(100) NOT NULL default '',
PRIMARY KEY (id)
) TYPE=MyISAM;
Tracking #: 5CF2A36BDC27D14BA1C3A19CBAC7214ED510CB7E
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]