hi.
someone please help me with this:
i have 2 tables:
table aktuell: (workshops)

and table termine: (dates) ( ws_id is the reference to id in table aktuell )

a workshop can have more than one target dates.
my problem now is to select both tables and put it ino an array.
also there is a pagination- function.
the result should be:
Title: xxxxxxxxxxxxxxxx
date #1: xx.xx.xxxx
date #2: xx.xx.xxxx
date #3: xx.xx.xxxx
Title: yyyyyyyyyyyyyyyy
date #1: xx.xx.xxxx
...and so on...
$dataCollection = array();
$getData ="SELECT * FROM $table_termine".$pre_fix." GROUP BY ws_id ORDER BY datum ASC";
$result = mysql_query ($getData) or die ("invalid query1 ".$getData);
$num = mysql_num_rows($result);
while($row = mysql_fetch_array($result)) {
/* print('<pre>');
print_r($row);
print('</pre>'); */
$table_aktuell".$pre_fix.".id = $table_termine".$pre_fix.".ws_id GROUP BY $table_aktuell".$pre_fix.".titel ORDER BY $table_termine".$pre_fix.".datum ASC";
$querystring2 = "SELECT * FROM $table_aktuell".$pre_fix." WHERE deleted = 'false' AND id = '".$row['ws_id']."'";
$getData2 = mysql_query ($querystring2) or die ("invalid query2 ".$querystring2);
$num2 = mysql_num_rows($getData2);
if ($rowData = mysql_fetch_assoc($getData2)) {
do {
$dataCollection[] = $rowData;
/* print('<pre>');
print_r($dataCollection);
print('</pre>'); */
/* $getData3 ="SELECT * FROM $table_termine".$pre_fix." WHERE ws_id = '".$row['ws_id']."' ORDER BY datum ASC";
$result3 = mysql_query ($getData3) or die ("invalid query1 ".$getData3);
$num3 = mysql_num_rows($result3);
while($row3 = mysql_fetch_assoc($result3)) {
//echo $row3['datum'].'_'.$row['ws_id'].'<br>';
print('<pre>');
print_r($dataCollection);
print('</pre>');
array_push($dataCollection[], $row3);
} */
} while($rowData = mysql_fetch_assoc($getData2));
/* print('<pre>');
print_r($dataCollection);
print('</pre>'); */
}
}
include 'php-array-pagination/pagination.class.php';
$pagination = new pagination;
//************************_DISPLAY_FILTER_*****************************
$count = 0;
foreach ($dataCollection as $testArray) {
$value = $testArray['datum'];
if($display_out_of_date == "false"){ // $display_out_of_date = variable aus html_config
if($value < today()){
//echo "VALUE = ".$value."<br>";
if (false !== ($key = array_search($value,$dataCollection[$count])))
{
unset($dataCollection[$count]);
}
}}
//********************************************
$value = $testArray['display'];
if($value == "false"){
//echo "VALUE = ".$value."<br>";
if (false !== ($key = array_search($value,$dataCollection[$count])))
{
unset($dataCollection[$count]);
}
}
$count++;
}
//******************************************************
//********************____CONTENT____************************************************************
if (count($dataCollection)) {
$productPages = $pagination->generate($dataCollection, $ws_display_value);
if (count($productPages) != 0) {
$pageNumbers = '<div align="center" class="numbers">'.$pagination->links().'</div>';
echo '<table width="614" valign="top" align="left">';
// Loop through all the items in the array
foreach ($productPages as $productArray) {
echo '<tr><td align="left">
<span class="uberschrift">'.$productArray['titel'].' <br>'.if_date(0,$productArray['datum']).' '.if_date(1,$productArray['datum_bis']).'</p>
<p align="justify">';
//.if_image($productArray['img'],$productArray['display_img']).'
// echo $productArray['id'];
//****** DISPLAY IMAGE *********************************************
$querystring2 = "SELECT * FROM $table_images".$pre_fix." WHERE type = 'aktuell' AND parent_id = ".$productArray['id']." ";
$result2 = mysql_query ($querystring2) or die ("invalid query ".$querystring2);
while ($row2 = mysql_fetch_object($result2)){
$image = $row2->image;
// echo $image;
//if_image($row2->image,$productArray['display_img']);
if($productArray['display_img'] == "true"){
echo '<img src="upload/thumbs/'.$image.'" border="0" hspace="0" vspace="0" style="float: left; padding-right: 5px; padding-bottom: 1px;"/>';
}
}
//******************************************************************
echo '<span class="text">
'.myTruncate($productArray['text'],$text_cut).'</span></p>
<p align="right" class="text"><a href="aktuell_detail.php?nav='.$nav.'&page='.$page.'&ws_id='.$productArray['id'].'">mehr Info & Anmeldung.... </a></p></td></tr>';
}
// print out the page numbers beneath the results
//echo '</table>';
echo '<tr><td align="center">';
echo $pageNumbers;
echo '<br></td></tr>';
echo '</table>';
echo '<br><br>';
}
}
//}
$gets = '&page='.$page;
?>
thanks.
till.