Re: PHP4 and MySql - Search Results Question?

From: Date: Fri, 02 Aug 2002 23:01:16 +0000
Subject: Re: PHP4 and MySql - Search Results Question?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-110894@lists.php.net to get a copy of this message
You cannot have COUNT(*) without having GROUP BY -- hence, by search query will not produce the desired results -- I'm thinking that there may be something within PHP or MySQL (a Function) that reports the total found for a query whether or not a LIMIT clause is used? Thanks "Julio Nobrega" <inerte@hotmail.com> wrote in message news:20020802224542.21084.qmail@pb1.pair.com... > You could select everything, count the results, and just show 15 results. > > I am not sure that a COUNT() with LIMIT will perform the desired effect. > > -- > Julio Nobrega > Pode acessar: > http://www.inerciasensorial.com.br > > > "Jason Caldwell" <jason@thinkingman.org> escreveu na mensagem > news:20020802210130.66098.qmail@pb1.pair.com... > > I'm using PHP4 and MySQL -- > > > > I'm trying to write a small search engine -- got it working, however, what > > I'd like to do is return the TOTAL records found. > > > > You see, right now I am using LIMIT within my SQL -- so I only return 15 > > results at a time. > > > > How do I get the total (say for example there are 2000 records) -- do I > need > > to COUNT(*) first, then perform another SELECT query for my search? > > > > Or, is there a PHP/MYSQL command that returns the total records matching > my > > SELECT query irregardless of the LIMIT ?? > > > > Thanks > > Jason > > > > > >

« previous php.general (#110894) next »