[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: How to cycle through fields?
On Tue, Aug 17, 1999 at 05:20:19PM +0000, Dmitriy Katsman wrote:
> ****** message to minivend-users from Dmitriy Katsman <dmk@affordablecomputers.com> ******
>
> People!! Please help.. I am stuck!
>
> How to cycle through database fields (ud1 ud2 ud3 ... ud20)
> I need to go throught those fields in flypage.html and display only the
> ones that are not blank...
> I don't want to check every single one of them manually.. because later
> we might have 30, 40 or even 50 fields...
>
> I need some kind of a loop to do it!
There are ways to do this... but the is a very bad way to go about it.
The proper way would be to have two tables... say... products and uds.
Then you have a distinct key, such as code in your products database
that matches as many uds as you need it to... then do an sql query
SELECT products.product,uds.ud FROM products,uds WHERE product.code=uds.code
something like that... it'd make your life much easier... and probably
make your page go quicker.
--
Anthony Ball ant@maine.com
MaineStreet Communications, Inc 208 Portland Road, Gray, ME 04039
tel:1.207.657.5078 fax:1.207.657.5048 http://www.maine.com/