Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003
    Posts
    17

    Unanswered: Multiple Sum() query help

    I am having troubles finding a good example of a query or set of querys that can run this. If anyone could send me an example or an idea it would be appreciated.

    table 1
    ---------
    correct
    last
    mon

    table 2
    ----------
    prvr
    upd

    I need to select the SUM(correct),SUM(last) where field = whatever,SUM(mon), also need to select one value from "prvr and upd" where field = whatever with the possibility of ordering the values etc.....

    I would like to minimize this to one query if possible.

    In the end I need to display all of this data in a table in the order of:
    correct,last,prvr,upd,mon.

    Thanks in advance!!!!!
    DD

  2. #2
    Join Date
    Feb 2003
    Posts
    17

    found alittle insight

    $query = "query1;query2;query3";
    function sendquery( $db_host, $db_base, $db_user, $db_pw, $query )
    {
    $connection = 'Connection with server ' . $db_host . ' failed';
    mysql_connect( $db_host, $db_user, $db_pw ) or die( errorhandle($connection));
    mysql_select_db( $db_base ) or die( errorhandle($connection));

    $array = explode( ';', $query );
    foreach( $array as $value )
    {
    if( !$result = mysql_query( $value ))
    break;
    }
    return $result;
    }

    Can run multiple queries in one shot. But still not the answer I am looking for. Anyone have an idea???

    DD

Posting Permissions

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