you could count the number of records in your table first. Then if count is greater than 0 you can do your max selection. I assume you are trying to find the max value stored in a field. Such as, the largest row_id.
Paul Rensel wrote: > > Hi there, > > I want to use a "select max(some_item) from db where item = 'something" > query. > > How can i check or test if there is indeed a max(some_item) for a given > 'something' selection given and when there's not an max(some_item) ?? > > I've tried everything like $sth->rows and such but it seems that the max() > functions ALWAYS returns a record, even when there's no max(some_item) > > Thanks, > > Paul
