Hi,
(my writen english in not the best so ....😶 )
i want to correcty insert the syntax from my code in "Where SQL"
now i put the code into "footer" but this way i think is not correct
i want to summate columns like this (i post the completly code)
noting in "where sql"
header
body
footer
it works so far but i think the way is not correct and i want do the statement in "where sql" section
please help me
thank a lot
Andy
(my writen english in not the best so ....😶 )
i want to correcty insert the syntax from my code in "Where SQL"
now i put the code into "footer" but this way i think is not correct
i want to summate columns like this (i post the completly code)
noting in "where sql"
header
statistik von spieler hans
{pagination}
<table border="0" width="300" cellspacing="0" cellpadding="0" id="table1">
<tr>
<td>Tag</td>
<td>Trainingszeiten</td>
<td>Spielzeiten</td>
</tr>
body
<tr>
<td>{cf_id}</td>
<td>{text_0}</td>
<td>{text_1}</td>
</tr>
footer
<?php
$DBhost = "localhost";
$DBuser = "myusername";
$DBpass = "mypasswort";
$DBName = "mydbname";
$table = "jos_chronoforms_Spielerstatistik";
$sum1 = 0;
$sum2 = 0;
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
mysql_select_db("$DBName") or die("Unable to select database $DBName");
$result = mysql_query("SELECT * FROM $table");
while ($row = mysql_fetch_row($result)) {
$sum1 += $row[5];
$sum2 += $row[6];
}
?>
<tr>
<td>Gesamt</td>
<td><?php print "$sum1"; ?></td>
<td><?php print "$sum2"; ?></td>
</tr></table>
it works so far but i think the way is not correct and i want do the statement in "where sql" section
please help me
thank a lot
Andy