PHP/MySQL: using MIN() on an empty set of rows -> query error
From: Jim Hatfield (jim.hatfield_at_insignia.com)
Date: 08/31/04
- Next message: Andrew DeFaria: "Re: PHP debugging"
- Previous message: Steve: "Re: Alternative to "glob""
- Next in thread: Jim Hatfield: "Re: PHP/MySQL: using MIN() on an empty set of rows -> query error"
- Reply: Jim Hatfield: "Re: PHP/MySQL: using MIN() on an empty set of rows -> query error"
- Maybe reply: Steve: "Re: PHP/MySQL: using MIN() on an empty set of rows -> query error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 31 Aug 2004 16:22:26 +0100
I'm using: "select min(objid) from table_name where objid > $objid"
to select the next row in a sequence where there may be gaps. It
works fine unless the where clause results in an empty set.
>From the command line, a value is *always* returned, which is NULL
when the set of rows selected by the where clause is empty. I wasn't
sure what I expected mysql_query to return. I didn't expect a FALSE
result, since the query is syntactically valid, but that's what I got.
Surely this is a bug? An empty result set would seem to be the correct
response, not a query error.
jim
-- Jim Hatfield
- Next message: Andrew DeFaria: "Re: PHP debugging"
- Previous message: Steve: "Re: Alternative to "glob""
- Next in thread: Jim Hatfield: "Re: PHP/MySQL: using MIN() on an empty set of rows -> query error"
- Reply: Jim Hatfield: "Re: PHP/MySQL: using MIN() on an empty set of rows -> query error"
- Maybe reply: Steve: "Re: PHP/MySQL: using MIN() on an empty set of rows -> query error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]