trying not to make a table with a ton of columns. instead making a few columns and a ton of rows (or records).
if i did this with a ton of columns i would know how to do this, but how do you do this with multiple rows/records?
i have a table with these fields:
id, product_category, product_name, quantity_range, discount_amt
there are going to be a lot of records, but i'll just shorten it to a few rows for this question.
lets say i had these records:
1 Post Card 4x6 5M to 9,999 0.007
2 Post Card 4x6 10M to 14,999 0.01
3 Post Card 4x6 15M to 19,999 0.013
4 Post Card 4x6 20M to 24,999 0.015
5 Post Card 4x6 Over 25M 0.019
now what i want to do is make a group of variables of all the values in just the discount_amt column.
so i select everything in table like so:
$pricediscountquery = mysql_query("SELECT * FROM pricing_discount") or die(mysql_error());
then loop through result/rows like this:
while($pricingdiscountrow = mysql_fetch_array( $pricediscountquery )) {
//echo $pricingdiscountrow['product_category']." ";
//echo $pricingdiscountrow['product_name']." ";
//echo $pricingdiscountrow['quantity_range']." ";
echo $pricingdiscountrow['discount_amt']." ";
echo "<br />";
}
this displays all the values of the column in a single variable name. i don't want that. i wan't a variable for 0.007, a different variable for 0.01, a different variable for 0.013, a different variable for 0.015, and a different variable for 0.019.
how do i do that?