For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > December 2007 > Querying & Displaying a pricing table









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Querying & Displaying a pricing table
Ron Piggott

2007-12-24, 10:02 pm

I am trying to query my rate_plan table and then display the results in
a table format. I need help developing then SELECT syntax and how I am
able to echo the results in a <table>. I want to display the results 7
columns, 4 rows. There are 7 tenures:

I have rate plans set up for:
1 w (term =1; unit =1)
2 ws (term =2; unit =2)
3 ws (term =3; unit =2)
1 month (term =1; unit =3)
6 ws (term =6; unit =1)
2 months (term =2; unit =4)
3 months (term =3; unit =4)

I have advertising rate plans ("type" field) 1 to 4 stored in the table
and the available and expires date of each plan.

The field "unit" is meant to express:
1 for W
2 for Ws
3 for Month
4 for Months

The table structure for rate_plan is:

reference int(3) auto_increment
name varchar(50)
type int(1)
term int(5)
unit int(1)
rate decimal(4,2)
available date
expires date


The "rate" field is the dollar value for the rate plan.

Would someone help me develop the syntax for this? This is the first
time I have tried to do something like this and I am not sure how to
start.

If you feel I need to re-design my table to make it simpler I don't
think I mind, although I would prefer it stays like it is now. I am
back in the learning curve with this syntax.

Thanks,

Ron
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com