Jump to content

Confused...Best method to solve this problem.


stig1

Recommended Posts

Hopefully someone might be able to point me in the right direction here as I am very confused on the best method to solve my problem.

 

I can get the data out of mysql without a problem.

 

I require one of the following tables to display on the website depending on the data that comes from my table. This is how I would like to see the tables on the website. Example tables below:

 

Price Table 1:

 

Item Code

Description

Qty

Roll Price

Bulk Buy

Bulk Price

Pallet Price

Pallet Buy

QTY

73524

#735 Polytape 24mm x 75m CLEAR

144

99.99

720

99.99

6912

99.99

[/td]

 

Price Table 2:

 

Item Code

Description

Qty

Roll Price

Bulk Buy

Bulk Price

QTY

73524

#735 Polytape 24mm x 75m CLEAR

144

99.99

720

99.99

 

Price Table 3:

 

Item Code

Description

Price Each

QTY

38000

Pistol Grip 50mm

99.99

 

The part I am having trouble with is thinking of the best method to create these, as some items do not have all the information. For example.

 

Item Code

Description

Qty

Roll Price

Bulk Buy

Bulk Price

Pallet Price

Pallet Buy

QTY

73524

#735 Polytape 24mm x 75m CLEAR

144

99.99

720

99.99

6912

99.99

73536

#735 Polytape 36mm x 75m CLEAR

144

99.99

720

99.99

 

What I would like to know is what function I could run through the records in the database to decide what price table to use.

 

For example if there is only 1 qty in the qty field.. use price table 3.. if there 2 qty fields with data use price table 2.. else use price table 1.

 

However you could have the data like below:

 

Item Code

Description

Qty

Roll Price

Bulk Buy

Bulk Price

Pallet Price

Pallet Buy

QTY

73524

#735 Polytape 24mm x 75m CLEAR

144

99.99

720

99.99

73536

#735 Polytape 36mm x 75m CLEAR

144

99.99

720

99.99

6912

99.99

[td]

 

That would only pick up a two qty table to display. How can you check all records in the database and then decide on the price table best suited.

 

Hopefully someone would be able to point me in the right direction! Thankyou

 

I was thinking if i can run a script that goes through all the records first for that particular product, and if there one record with 3 breaks use that price table..

 

So confused....

 

Here is a couple of sample links... to show people what I am trying to achieve, however they do it using .net

 

Price Table 1

http://www.signet.net.au/Catalogue/browse.aspx?sid=580

 

Price Table 2

http://www.signet.net.au/Catalogue/browse.aspx?sid=596

 

Price Table 3

http://www.signet.net.au/Catalogue/browse.aspx?sid=584

 

Hopefully someone will be able to help me out :) Not asking for the code.. just a helpful idea!

Well, you can just have one table with all the fields and if any are empty, just check for them and not display them. Simple as that. You can set the table's columns to a default value of " ". That way, the table display won't look weird.

 

And you can use SQL to select results by quantity.

Hey Ken2k7, I just updated the post with some links.

 

The data is stored all in one mysql table. I can pull the data out no problem.

 

For example:

 

Price Table 1

 

http://www.ozebuy.com.au/~new/browse.php?c=1&csID=2

 

Price Table 2

http://www.ozebuy.com.au/~new/browse.php?c=1&csID=21

 

Price Table 3

 

http://www.ozebuy.com.au/~new/browse.php?c=1&csID=1

 

But i want to be able to create the above tables via html depending on the data requirements.

 

 

I am actually thinking, of running a script that will do the following....

 

loop through all the records related to the product group, if pallet buy has a qty use table with 3 columns.

 

if not, loop through all the records related to the product group, if bulk buy exists use tabe with only bulk buy, so i do not show pallet...

 

if only qty exists and the other columns are empty use price each table.

 

would that possible work? it would mean 3 loops and then extract the data into the tables to display...

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.