Ok so i have this page and when viewed in firefox the proper results show up but when i look at it in chrome or safari it is way off. Could it be the funky php loop that i am using that makes it off in the browsers..Here is my code
I am generating a left and right array..seems like a hack to me
$left = array();
$right = array();
$finaltot=0.00;
for($i=0;$i<count($steps);$i++)
{
$sql="SELECT * FROM configure_system WHERE EstimateID='".$_SESSION['ESTQUOTE']."' AND StepID=".($i+1) ;
$expstep=ExecuteGetRows($sql);
if ($i % 2 == 0) {
$sql="SELECT SUM(TotalPrice) AS TOT FROM configure_system WHERE EstimateID='".$_SESSION['ESTQUOTE']."' AND StepID=".($i+1);
$tots=ExecuteGetRows($sql);
$left["Step"][$i][] = $steps[$i];
$left["expstep"][$i][] = $expstep;
$left["final_total"][$i][] = $tots[0]['TOT'];
$finaltot+=$tots[0]['TOT'];
} else {
$sql="SELECT SUM(TotalPrice) AS TOT FROM configure_system WHERE EstimateID='".$_SESSION['ESTQUOTE']."' AND StepID=".($i+1);
$tots=ExecuteGetRows($sql);
$right["Step"][$i][] = $steps[$i];
$right["expstep"][$i][] = $expstep;
$left["final_total"][$i][] = $tots[0]['TOT'];
$finaltot+=$tots[0]['TOT'];
}
then since the left array only has 0,2,4,6,8,10
and right has 1,3,5,7,9,11
so my loops are like this
<?php for($i=0;$i<count($left['Step']) * 2;$i++) { ?>
<?php $i++; ?>
<?php } ?>
<?php for($i=1;$i<count($right['Step'])* 2;$i++) { ?>
<?php $i++; ?>
<?php } ?>
So as you can see the code is a bit off and i think that maybe the problem with why safari and chrome are off…any suggestions
Why do not use foreach instead?
Also you could get the same results with only one query: