Probleem met volgende pagina en queries
[linebreak]<head>[linebreak]<style type="text/css">[linebreak]body, td, th, h1, h2 {font-family: sans-serif;}[linebreak]body, td, th {font-size: 100%;}[linebreak]a:link { font-weight:bold; color:E00000; text-decoration:none }[linebreak]a:visited { font-weight:bold; color:E00000; text-decoration:none }[linebreak]a:hover { font-weight:bold; color:#E00000; text-decoration:none }[linebreak]a:active { font-weight:bold; color:#F00000; text-decoration:none }[linebreak]a:focus { font-weight:bold; color:#E00000; text-decoration:none }[linebreak].text1 {font-family: Arial, Helvetica, sans-serif;font-size: 16px;color: White;text-align : left;}[linebreak]</style>[linebreak]<script language="javascript">[linebreak]function call(location)[linebreak]{[linebreak]url = new String(parent.sub.location.href);[linebreak]arrayOfStrings = url.split(#);[linebreak]parent.sub.location = arrayOfStrings[0] + location;[linebreak]return false;[linebreak]}[linebreak]</script>[linebreak]</head>[linebreak][linebreak]<body bgcolor="#777888">[linebreak][linebreak]Code (php) 123456789101112131415161718192021 <? include "datas/connection_data.php"; include "datas/connect.php"; include "datas/stats2.php"; $Dblnk=connect ();if ($res=send_sql($Data_Base, $Query)) { while ($row = mysql_fetch_row ($res)) { $Line1 = $Line1.$row[0]." <BR>"; }}?> [linebreak][linebreak]<TABLE bgcolor="#777888" border="1" width="100%">[linebreak]<TR>[linebreak] <TD align="center" colspan="22" bgcolor="grey"><B><FONT size="+2">Rem amount POR</FONT></B></TD></TR>[linebreak]<TR>[linebreak] <TD align="center" colspan="1"><B>Dealer</B></TD>[linebreak] <TD align="center" colspan="1"><B>Jan2004</B></TD>[linebreak] <TD align="center" colspan="1"><B>Feb2004</B></TD>[linebreak] <TD align="center" colspan="1"><B>Mar2004</B></TD>[linebreak] <TD align="center" colspan="1"><B>Apr2004</B></TD>[linebreak] <TD align="center" colspan="1"><B>MAY2004</B></TD>[linebreak] <TD align="center" colspan="1"><B>JUN2004</B></TD>[linebreak] <TD align="center" colspan="1"><B>JUL2004</B></TD>[linebreak] <TD align="center" colspan="1"><B>AUG2004</B></TD>[linebreak] <TD align="center" colspan="1"><B>Sep2004</B></TD>[linebreak] <TD align="center" colspan="1"><B>OCT2004</B></TD>[linebreak] <TD align="center" colspan="1"><B>NOV2004</B></TD>[linebreak] <TD align="center" colspan="1"><B>Dec2004</B></TD>[linebreak] <TD align="center" colspan="1"><B>Totaal</B></TD>[linebreak]<TR align="center">[linebreak] <TD width="10%">Dealer</TD>[linebreak] <TD width="10%">Amount</TD>[linebreak] <TD width="10%">Amount</TD>[linebreak] <TD width="10%">Amount</TD>[linebreak] <TD width="10%">Amount</TD>[linebreak] <TD width="10%">Amount</TD>[linebreak] <TD width="10%">Amount</TD>[linebreak] <TD width="10%">Amount</TD>[linebreak] <TD width="10%">Amount</TD>[linebreak] <TD width="10%">Amount</TD>[linebreak] <TD width="10%">Amount</TD>[linebreak] <TD width="10%">Amount</TD>[linebreak] <TD width="10%">Amount</TD>[linebreak] <TD width="10%">Amount</TD></TD>[linebreak] </TR>[linebreak] <TR>[linebreak] <TD width="10%">Code (php) 1 <? echo "$Line1" ?> </TD></TR>[linebreak][linebreak] </TR>[linebreak]</TABLE>[linebreak]
en ik gebruik de volgende query die bij wordt gebruikt
[linebreak]Code (php) 123 <?$Query = "SELECT DISTINCT DEALER_REM FROM ELEC_REM_NOTE WHERE CURRENT_MONTH like %2004group by Dealer_rem";?> [linebreak][linebreak][linebreak]de query die ik in ieder geval nodig heb om de resultaten weer te geven is de volgende :[linebreak][linebreak]$jan = "SELECT DISTINCT DEALER_REM ,SUM(TOTAL_REM_AMOUNT) FROM ELEC_REM_NOTE WHERE CURRENT_MONTH =JAN2004AND BLOC_ID IN(1,2,3,4,5,7,8,10,12) group by Dealer_rem";[linebreak][linebreak]dit geeft me het gewenste resultaat wat ik nodig heb. deze query moet ik dus 12 keer hebben voor iedere maand van het jaar 1[linebreak][linebreak]ik zit vast want ik weet niet hoe ik nu de juiste query moet aanroepen om de juiste gegevens in de juiste kolom te krijgen en die ook nog overeenstemt met het resultaat van die maand[linebreak][linebreak]bijv :[linebreak]jan die verkoopt in Januari 0 maar in Feb 3 stuks.[linebreak]dus ik zou Jan op de eerste rij hebben met in de kolom january2004 als resultaat 0 en in de kolom van february 3[linebreak]op de tweede rij piet die in jan 5 stuks verkocht heeft en in february 3[linebreak]enz[linebreak][linebreak][linebreak]alvast bedankt voor de moeite en feedback[linebreak][linebreak]Paul
$Query = "SELECT DISTINCT DEALER_REM FROM ELEC_REM_NOTE WHERE CURRENT_MONTH like '%2004'group by Dealer_rem";
$res = mysql_query($Query);
$jan = "SELECT DISTINCT DEALER_REM SUM(TOTAL_REM_AMOUNT) FROM ELEC_REM_NOTE WHERE CURRENT_MONTH ='JAN2004' AND BLOC_ID IN(1,2,3,4,5,7,8,10,12) group by Dealer_rem";
?>
$res_jan = mysql_query($jan);
graag ff normale naam opgeven :)
ik heb nu de volgende pagina samengesteld
<head>
<style type="text/css">
body, td, th, h1, h2 {font-family: sans-serif;}
body, td, th {font-size: 100%;}
a:link { font-weight:bold; color:E00000; text-decoration:none }
a:visited { font-weight:bold; color:E00000; text-decoration:none }
a:hover { font-weight:bold; color:#E00000; text-decoration:none }
a:active { font-weight:bold; color:#F00000; text-decoration:none }
a:focus { font-weight:bold; color:#E00000; text-decoration:none }
.text1 {font-family: Arial, Helvetica, sans-serif;font-size: 16px;color: White;text-align : left;}
</style>
<script language="javascript">
function call(location)
{
url = new String(parent.sub.location.href);
arrayOfStrings = url.split('#');
parent.sub.location = arrayOfStrings[0] + location;
return false;
}
</script>
</head>
<body bgcolor="#777888">
Code (php)
nogmaals bedankt voor de hulp
Paul
Quote:
door
¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿
¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿
ben ik niet de enige die die ¿ zo leuk vind hé bas