[Phpsig] Issue with web page display of MySQL values
randall perry
phpsig@kalamazoolinux.org
Thu, 12 Sep 2002 16:07:45 -0200
--=======4962505E=======
Content-Type: text/plain; x-avg-checked=avg-ok-766045B1; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 8bit
Great tips Bill, I am excited to try them out (won't be till Sunday
Afternoon, though).
Thanks Again,
PS, Paul, are you taking notes? Good stuff here.
Randall Perry
www.fasnap.com
www.Davenport.edu
www.domain-logic.com
At 03:56 PM 9/12/2002 -0400, you wrote:
>Glad to have helped.
>
>So you're doing four queries to 1) get the info 2) get the total hits, 3)
>get a back
>button and 4) get a forward button.
>
>Here's how to get that down to one query.
>
>Always display a BACK button unless it is the first page of the search.
>Eliminating
>query 3 above.
>
>To do NEXT buttons it is easier to just do a query with a limit of one
>more than what
>you're displaying. If you're going to show a list of ten, query for
>eleven. Display
>the ten. If there is an eleventh row, display a NEXT button. If not,
>don't. When
>they click the NEXT button, just start your query at 11 and query to 21,
>etc. This
>eliminates query 4 above.
>
>You only need to do a full query (without LIMIT, query 2 above) if you're
>trying to
>report the total number of hits or if you're trying to do like Google and
>display the
>all the possible pages to jump to (so having 100 results would allow for
>jumping
>directly to page 7 of the results, for example).
>
>It's almost always easier to just do one query and do different things
>with the
>results.
>
>There are other ways, I've tried a few. But this seems easiest.
>
>
>randall perry wrote:
>
> > At 03:16 PM 9/12/2002 -0400, you wrote:
> >
> > >More questions:
> > >
> > >Why do you have four queries in lines 94 - 112 that are essentially
> the same?
> > It was supposed to ease navigation when returning 1 page of info at a time.
> >
> > >For example, if you changed line 107 to be
> > >
> > >$num_rows = mysql_num_rows($show);
> > >
> > >you could eliminate an entire query (lines 96, 101, & 106).
> > >
> > >Why do all the queries only look at one table, ipaddress? Are you
> > >intending on
> > >getting information from the other tables site and device? If so, you
> > >have to call
> > >them, changing this:
> > >
> > >SELECT * from ipaddress WHERE $wherez LIKE \"%$search%\"
> >
> > This is EXACTLY what I was looking for!! Thanks Bill.
> >
> > >to this
> > >
> > >SELECT * from ipaddress, site
> > >WHERE site_name LIKE \"%$search%\"
> > >AND ipaddress.siteid=site.siteid
> >
> > Randall Perry
> > www.fasnap.com
> > www.davenport.edu
> > www.domain-logic.com
> >
> >
> --------------------------------------------------------------------------------
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.385 / Virus Database: 217 - Release Date: 9/4/2002
>
>_______________________________________________
>Phpsig mailing list
>Phpsig@kalamazoolinux.org
>http://www.kalamazoolinux.org/mailman/listinfo/phpsig
>
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.385 / Virus Database: 217 - Release Date: 9/4/2002
--=======4962505E=======
Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-766045B1
Content-Disposition: inline
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.385 / Virus Database: 217 - Release Date: 9/4/2002
--=======4962505E=======--