Bug #13799: PHP selects rows correctly but adds them up wrong

From: Date: Tue, 23 Oct 2001 12:46:50 +0000
Subject: Bug #13799: PHP selects rows correctly but adds them up wrong
Groups: php.dev 
Request: Send a blank email to php-dev+get-68799@lists.php.net to get a copy of this message
From: j.ball@rgu.ac.uk Operating system: Windows 98 PHP version: 4.0.6 PHP Bug Type: *Database Functions Bug description: PHP selects rows correctly but adds them up wrong Using MySQL through the Apache server with a reproduction of the Northwind database (as supplied by MicroSoft). The command: SELECT DISTINCT Customers.* FROM Customers, Orders WHERE Customers.CustomerID = Orders.CustomerID; This works OK when executed by MySQL in DOS (returning 20 records in my version of the Northwind Database). In PHP the command also returns 20 records but PHP incorrectly reports "Showing records 0-30 (387)" at the top of the page. If I leave out the 'DISTINCT' command I get the full 387 records with a correct report "Showing records 0-30 (387)". I amend the query as follows: SELECT DISTINCT Customers.* FROM Customers, Orders WHERE Customers.CustomerID = Orders.CustomerID ORDER BY Customers.CustomerID; PHP now shows the same 20 records and declares "Showing records 0-20 (20)" this time correctly. -- Edit bug report at: http://bugs.php.net/?id=13799&edit=1

« previous php.dev (#68799) next »