Querying & Displaying a pricing table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 week (term =1; unit =1)
2 weeks (term =2; unit =2)
3 weeks (term =3; unit =2)
1 month (term =1; unit =3)
6 weeks (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 Week
2 for Weeks
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

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux