Forum Moderators: coopster
$result = mssql_query("select t0.*, t1.Lname, t1.GroupID from HB1group t0 inner join HB1location t1 on t0.GID = t1.GroupID and t1.GroupID ='$GroupID'");$exist = 6;
$counts = 1;
if($exist > 0)
{
for ($i = 0; $i < $exist; $i++)
{
$Lname = mssql_result($result, $i, "Lname");echo '<th><h1 class="flue">'.$Lname.'</h1></th>';
$pieces = print_r(explode(" ", $counts));$zero[0];
$one[1];
$two[2];
$tree[3];
$four[4];
$five[5];
$counts++ ;
}}
else
{
echo '<h1 class="flue">NO Entry</h1>';}
return:
Array ( [0] => 1 ) Array ( [0] => 2 ) Array ( [0] => 3 ) Array ( [0] => 4 ) Array ( [0] => 5 ) Array ( [0] => 6 )
my question is how can i put "," in order me to get the value of 1,2,3,4,5,6 so that my function explode work..
return:
Array ( [1] => 1 ) Array ( [2] => 2 ) Array ( [3] => 3 ) Array ( [4] => 4 ) Array ( [5] => 5 ) Array ( [6] => 6 )
tnx ^^
$counts = 1;
if($exist > 0)
{
for ($i = 0; $i < $exist; $i++)
{
$Lname = mssql_result($result, $i, "Lname");
echo '<th><h1 class="flue">'.$Lname.'</h1></th>';
$pieces = print_r(explode(" ", $counts));
I think you are going to have to find a different solution to your issue.
for example:
for by 3
one_two_tree
1_2_3
1_2_3
total horizontal 2_4_6
total Vertical 6_6
total H+v = 24
there no problem about the vertical total i figure it out but its so hard for me to get the horizontal because my horizontal value is not fix
<?php$resultz = mssql_query("select * from vessel");
$col = mssql_num_rows($resultz);if($col > 0)
{
for($b=0; $b < $col; $b++)
{
$WeekID= mssql_result($resultz, $b, "WeekID");
$VesselName = mssql_result($resultz, $b, "VesselName");echo '<tr>';
echo '<td id="info"><b>'.$VesselName.'<b></td>';$sum = 0;
$resulta = mssql_query("select t0.*, t1.* from TTransactionTable t0
inner join HB1location t1 on t1.LocationID = t0.Grouping where t0.VID=".$WeekID." and t0.Groupid = '$GroupID' and t0.WeekNo = '$week' and t0.GetDate = '$fromdate'");
$row = mssql_num_rows($resulta);if($row > 0)
{
for($c=0; $c < $row; $c++)
{
$inputTable= mssql_result($resulta, $c , "inputTable");
$sum = $sum + $inputTable;
if (($c%2) == 0)
{
$css = ' bgcolor="#E4E4E4"';
}
else
{
$css = 'bgcolor="#D5F1D0"';
}echo '<td '.$css.' id="number">'.$inputTable.'</td>';
}
echo '<td id="total">'.$sum.'</td>';
echo '</tr>';}
else
{
echo '';
}
}
}
else
{
echo '<h1>NO POSTED YET</h1>';
}
?>