Ignore:
Timestamp:
04/13/06 11:40:35 (18 years ago)
Author:
bastiaans
Message:

web/addons/job_monarch/libtoga.php:

  • fixed: SQL error that occured when viewing 1 single jobid
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/addons/job_monarch/libtoga.php

    r248 r251  
    144144                global $SEARCH_RESULT_LIMIT;
    145145
    146                 if( $id )
    147                         $query = "SELECT job_id FROM jobs WHERE job_id = '$id' AND job_status = 'F'";
    148                 else {
     146                if( $id ) {
     147                        $select_query = "SELECT job_id FROM jobs WHERE job_id = '$id' AND job_status = 'F'";
     148                        $this->resultcount = 1;
     149                } else {
    149150                        $query_args = array();
    150151                       
     
    175176                        }
    176177                        $query .= $extra_query_args;
    177                 }
    178 
    179                 $count_result_idname = "COUNT(job_id)";
    180                 $select_result_idname = "job_id";
    181 
    182                 $count_query = "SELECT " . $count_result_idname . " " . $query;
    183 
    184                 $count_result = $this->queryDbase( $count_query );
    185                 $this->resultcount = (int) $count_result[0][count];
    186 
    187                 $select_query = "SELECT " . $select_result_idname . " " . $query . " ORDER BY job_id LIMIT " . $SEARCH_RESULT_LIMIT;
     178
     179                        $count_result_idname = "COUNT(job_id)";
     180                        $select_result_idname = "job_id";
     181
     182                        $count_query = "SELECT " . $count_result_idname . " " . $query;
     183
     184                        $count_result = $this->queryDbase( $count_query );
     185                        $this->resultcount = (int) $count_result[0][count];
     186
     187                        $select_query = "SELECT " . $select_result_idname . " " . $query . " ORDER BY job_id LIMIT " . $SEARCH_RESULT_LIMIT;
     188                }
     189
    188190                $ids = $this->queryDbase( $select_query );
    189191
Note: See TracChangeset for help on using the changeset viewer.