Dynamic Grouped table using PHP

  • ekke
  • Born
  • Born
  • User avatar
  • Posts: 2
  • Loc: South Africa

Post 3+ Months Ago

Hi all,

I'm kinda lost in the dark here. I play around with php for the fun of aquiring a new skill. Im still a newbie @ writing php code. I have written a few scripts to generate basic tables with fixed header columns, but they were written very bulky & static. I was advised by a collegue to look into using dynamic generation of tables. He also mentioned redesigning my DB and use inner joins.

I'm trying to achieve having two drop down boxes. First with the Province, then when that is selected it populates the second box named Town. If possible I would like to have an option of "All" in both drop down boxes to facilitate pulling all of the data either of the whole country or only all the towns in a certain province.

I want to compile a table from a DB which contains the different pricing of a product at different stores. The final layout I want to look something like this:

<<Province Name>> //large font in bold
<<Town Name>> // smaller font in bold
<Retailer Name>> ||<<Brand name>> ||<<Price>>
<Retailer Name>> ||<<Brand name>> ||<<Price>>
<Retailer Name>> ||<<Brand name>> ||<<Price>>
<Retailer Name>> ||<<Brand name>> ||<<Price>>

If possible also a layout in which I list all entries in the DB. For example:

<<Province Name>> //large font in bold
<<Town Name>> // smaller font in bold
<Retailer Name>> ||<<Brand name>> ||<<Price>>
<Retailer Name>> ||<<Brand name>> ||<<Price>>
<Retailer Name>> ||<<Brand name>> ||<<Price>>
<<OPEN LINE HERE>>
<<Town Name>> // smaller font in bold
<Retailer Name>> ||<<Brand name>> ||<<Price>>
<Retailer Name>> ||<<Brand name>> ||<<Price>>
<<OPEN LINE HERE>>
<<Town Name>> // smaller font in bold
<Retailer Name>> ||<<Brand name>> ||<<Price>>
<<OPEN LINE HERE>>
<<Province Name>> //large font in bold
<<Town Name>> // smaller font in bold
<Retailer Name>> ||<<Brand name>> ||<<Price>>

You guys get the picture.

My Database layout look like follows:
Table Fields
province id, province
town id, town, province_id
retailer id, retailer, town_id
brand id, brandname, retailer_id
price id, price, brand_id

If you guys can help me in the right direction it would be greatly appreciated. I have no idea where to start and most of the help I find on google is way over my head. I was able to do this in Access quite quickly, but PHP is getting the better of me.

Thank you in advance. As I have mentioned ANY help is apprectiated.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • dheerhot
  • Novice
  • Novice
  • User avatar
  • Posts: 34

Post 3+ Months Ago

http://www.javascriptkit.com/script/cut183.shtml
http://www.javascriptkit.com/script/scr ... ombo.shtml
  • ekke
  • Born
  • Born
  • User avatar
  • Posts: 2
  • Loc: South Africa

Post 3+ Months Ago

dheerhot thankz a lot for the links - I will try them definitely. They look like they will solve the first half of my problem.

The second link seems to be a bit truncated, can you please repost it.

Thankz a million!

Your help is much appreciated.
  • dheerhot
  • Novice
  • Novice
  • User avatar
  • Posts: 34

Post 3+ Months Ago

oh ur welcome, here is the 2nd link..

http://www.javascriptkit.com/script/scr ... ombo.shtml

there is one more try tht one also..

http://www.plus2net.com/javascript_tuto ... n-list.php
  • chrisdavies
  • Born
  • Born
  • chrisdavies
  • Posts: 2

Post 3+ Months Ago

you may be better of using javascript/ajax for the linked lists though. I have seen that working on many sites.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 40 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.