Advertisement

10.10.2008 at 01:22AM PDT, ID: 23803444 | Points: 500
[x]
Attachment Details

array problem

Asked by fabiogaravelli in PHP Scripting Language, PHP and Databases

Tags:

hi expert, i nedd help to resolve this problem.
i have a complex situation where the output of different query string is parsed by different for and foreach to obtain a sort of report.
before the report is generate i have two array
$vecservizio array that contain all the record of <tablename> for each service
$allcompdata array that contains  all the record of <tablename> for each component  to visualize.
To obtain the output
      for ($x=0;$x<count($vecservizio);$x++){
            
            echo $vecservizio[$x][1];
            echo "&nbsp;&nbsp;";
            echo $vecservizio[$x][3];
            echo "&nbsp;&nbsp;";
             //echo $vecservizio[$x][4];
            printf("%3.2f",$vecservizio[$x][4]);
            echo "&nbsp;&nbsp;";
             echo bcdiv($vecservizio[$x][2],3600,2);
             echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
             for ($y=0;$y<count($allcompdata);$y++){
                   if ($allcompdata[$y][1][$x][3] < $garsrv){
                         echo $allcompdata[$y][1][$x][3];
                         echo "&nbsp;&nbsp;";
                         printf("%3.2f",$allcompdata[$y][1][$x][4]);
                         echo "&nbsp;&nbsp;";
                         echo bcdiv($allcompdata[$y][1][$x][2],3600,2)."<br>";
                   }else{
                         echo $allcompdata[$y][1][$x][3];
                         echo "&nbsp;&nbsp;";
                         printf("%3.2f",$allcompdata[$y][1][$x][4]);
                         echo "&nbsp;&nbsp;";
                         echo bcdiv($allcompdata[$y][1][$x][2],3600,2)."<br>";
                   }
                   
             }
      }
in this situation i obtain output formatted like this
01-01-2008  100.00  0.00  0.00       100.00  0.00  0.00
01-02-2008  100.00  0.00  0.00       100.00  0.00  0.00
and so on...
How can i do put this result in one array ;

Thank'sStart Free Trial
 
Loading Advertisement...
 
[+][-]10.10.2008 at 03:01AM PDT, ID: 22685473

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.10.2008 at 03:02AM PDT, ID: 22685480

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.10.2008 at 03:23AM PDT, ID: 22685552

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.10.2008 at 03:44AM PDT, ID: 22685642

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.10.2008 at 03:45AM PDT, ID: 22685644

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42 / EE_QW_2_20070628