Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3482374
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:33:07+00:00 2026-05-18T10:33:07+00:00

Ok so i have this page and when viewed in firefox the proper results

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T10:33:07+00:00Added an answer on May 18, 2026 at 10:33 am

    Why do not use foreach instead?

    foreach ($right['Step'] as $i => $val) {
         // ...
    }
    

    Also you could get the same results with only one query:

      SELECT SUM(TotalPrice) AS TOT
        FROM configure_system
       WHERE EstimateID='".$_SESSION['ESTQUOTE']."'
    GROUP BY StepID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have viewed the source of this page and applied it to my page
I have this page which has three peson searchs on them. Basically it's a
I have this page: http://www.thedome.it/cmsms/index.php?page=alla-spina I'd like to send a newsletter to subscribers every
i have this page . login: fer password: m Note: after login you will
I have this serious: I have ASP.NET page, This page contents Update panel with
So I have this page here: http://www.eminentmedia.com/development/powercity/ As you can see when you mouse
So I have this page that has some basic custom tabs: http://demo.unlockedmanagement.com/users/view/2 * NOTE
He, I have this page where i have checkboxes next to every item in
I am using JQuery Accordion. I have this page here: http://www.hauppauge.com/site/support/support_colossus.html#tabs-6 What happens is
I have this PHP page where the user can select and un-select items. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.