Re: PHP and MYSQL

by "Rossi Designs" <webmaster(at)rossidesigns.net>

 Date:  Thu, 29 Jun 2000 23:37:17 -0400
 To:  "Shannon Doyle" <shannon(at)bigblue.net.au>,
<hwg-languages(at)hwg.org>
 References:  net
  todo: View Thread, Original
You'll probably want to use a group by clause in your query, then set a
variable on your page while displaying to $current_group and check the
category of each row against the variable and if they are not the same add a
new heading and change the variable.

Data Driven Design
P.O. Box 1084
Holly Hill, FL 32125-1084
Phone : (904) - 226-8979
URL : http://www.datadrivendesign.com
URL : http://www.rossidesigns.net
----- Original Message -----
From: "Shannon Doyle" <shannon(at)bigblue.net.au>
To: <hwg-languages(at)hwg.org>
Sent: Thursday, June 29, 2000 8:33 PM
Subject: PHP and MYSQL


>
> Hi fellow listers,
>
> I'm not sure if anyone on this list can help me, or even if I am posting
to
> the right list.
>
> I have a small question in regards to the use of PHP and MYSQL to extract
> information from the databse to be displayed on the site.
>
> I have a table in mysql containing all the relevant information that is
> needed to be displayed...Product description, price, category and sub
> category.
>
> This is where I have the problem.....
>
> The pages are all going to be dynamicallys generated through PHP obatining
> the product information from the db. This in itself is a pretty easy feat.
> However...The results from the MySQL query need to be sorted by
sub-category
> (easy enough with the order by statement) But!!!  Each section needs to
have
> a title added to it which is the sub-category name. I could hard code
these
> into the HTML but as the sub categories can change with each update to the
> database this is not the best option as the site will probably be getting
> updated almost daily.
>
> I was thinking that maybe I have to run simultaneous MySQl queries to the
> table to firstly obtain the sub category name, then perform a select using
> the sub category name as the where clause. I cannot for the life of me
work
> out how to perform the multiple SQL query without causing some serious
> overloads on the web server. Can anyone out there give me a suggested
model
> of performing this task?
>
> Any help at all would be greatly appreciated.
>
>
> Thanks in advance
>
>
>
> --------------------------------------------------------------------------
--
> -----------------
> Shannon Doyle
> Web Designer, BIGBLUE Internet
> 149 Hutt St, Adelaide, SA,
> Australia, 5000
> +61 (8) 8232 1444
> +61 412 098 714
> http://www.bigblue.net.au
>
>
>

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA