SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: php reports

  1. #1
    SitePoint Addict
    Join Date
    Sep 2004
    Location
    seattle
    Posts
    306
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php reports

    hi,

    can someone give me an example of how to create a report or point me to some tutorials? The data will be pulled from a table then put in a dropdown...i.e. a table that has start and end date where the user can choose what date range they want view the report from.
    what i'd like to do based on that start and end date I'd like to pull data from 4 tables. I'd like to do some calculations from the fields in the tables. (data - data * data)

    Thanks!

  2. #2
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I saw some reporting classes in the phpClasses archive. Maybe they can give you some ideas.

  3. #3
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Raleigh, NC
    Posts
    783
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by wakk0
    hi,

    can someone give me an example of how to create a report or point me to some tutorials? The data will be pulled from a table then put in a dropdown...i.e. a table that has start and end date where the user can choose what date range they want view the report from.
    what i'd like to do based on that start and end date I'd like to pull data from 4 tables. I'd like to do some calculations from the fields in the tables. (data - data * data)

    Thanks!
    which part of this are you asking how to build?

  4. #4
    SitePoint Addict
    Join Date
    Sep 2004
    Location
    seattle
    Posts
    306
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    would be the latter part.

  5. #5
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Raleigh, NC
    Posts
    783
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so you're asking how to pull data, manipulate it, and display it? i think you're going to have to be a little more specific than that

  6. #6
    SitePoint Addict
    Join Date
    Sep 2004
    Location
    seattle
    Posts
    306
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    maybe this will be easier..this is what I have so far:

    $query="select employees.empNo, employees.firstName, employees.lastName, numbers.lid, numbers.cars, numbers.dolAvg, goals.goal, training.training
    from employees, numbers, goals, training
    where employees.id= numbers.eid
    and numbers.eid = goals.eid
    and employees.id= training.eid";
    $result = mysql_query($query);
    echo "<table border=\"0\">";
    $j=true;
    while ($row = mysql_fetch_row($result))
    {
    if($j)
    $j=false;
    else
    $j=true;
    echo "<tr>";
    for ($i=0;$i<mysql_num_fields($result);$i++){
    if ($j){
    echo "<td bgcolor=\"#CCCCCC\">";
    }
    if (!$j){
    echo "<td bgcolor=\"#FFFFFF\">";
    }
    echo $row[$i];
    echo "</td>";
    }
    }
    echo "</table>";

    how would i do my calculations? (data - data) * data?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •