diff options
author | ivan <ivan> | 2002-06-05 22:46:26 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-06-05 22:46:26 +0000 |
commit | c9b608b9c0df8921d30055f18c23fd2d030afb25 (patch) | |
tree | a9f834cdd1548a9091de0dc465584690b3f5c9f7 /httemplate/search/cust_pkg.cgi | |
parent | abc9411d7d7c54cf5c888e57c0aaf629a7d0c70a (diff) |
more mysql goodness, thanks dale
Diffstat (limited to 'httemplate/search/cust_pkg.cgi')
-rwxr-xr-x | httemplate/search/cust_pkg.cgi | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi index 7dfacf189..abf6eee4c 100755 --- a/httemplate/search/cust_pkg.cgi +++ b/httemplate/search/cust_pkg.cgi @@ -86,7 +86,7 @@ if ( $cgi->param('magic') && $cgi->param('magic') eq 'bill' ) { WHERE cust_pkg.pkgnum = cust_svc.pkgnum AND cust_svc.svcpart = pkg_svc.svcpart AND cust_pkg.pkgpart = pkg_svc.pkgpart - GROUP BY cust_svc.pkgnum,cust_svc.svcnum"; + GROUP BY cust_svc.pkgnum,cust_svc.svcpart"; $sth = dbh->prepare($query) or die dbh->errstr. " preparing $query"; $sth->execute or die "Error executing \"$query\": ". $sth->errstr; @@ -129,12 +129,9 @@ if ( $cgi->param('magic') && $cgi->param('magic') eq 'bill' ) { $total = $sth->fetchrow_arrayref->[0]; - #if ( driver_name eq 'mysql' ) { #remove ORDER BY for mysql? hua? - # @cust_pkg = qsearch('cust_pkg',{}, '', "$unconf $limit" ); - #} else { - # @cust_pkg = qsearch('cust_pkg',{}, '', "$unconf ORDER BY pkgnum $limit" ); - #} - @cust_pkg = qsearch('cust_pkg',{}, '', "$unconf ORDER BY pkgnum $limit" ); + my $tblname = driver_name eq 'mysql' ? 'cust_pkg.' : ''; + @cust_pkg = + qsearch('cust_pkg',{}, '', "$unconf ORDER BY ${tblname}pkgnum $limit" ); if ( driver_name eq 'mysql' ) { $query = "DROP TABLE temp1_$$,temp2_$$;"; |