0

Hi again,

I'm working on a marquee components list for work and i'm stuck on something that seems pretty basic but it's totally flumped me!
I have a form with 10 fields, each representing a marquee size when the submit is clicked in effect it searches the database 10 times and adds together the components and outputs the totals needed.

The problem i have is there are 6m,9m,12m and 15m marquees (width of the marquee) and i only want to echo the specific things needed for the size inputted eg if we input a 6x12m marquee we dont want to see 9m legs = 0 (if you see where i'm at)

I thought a solution might be to add a field to the database (type) and give it a number (6,9,12,15) i was thinking of ;

if ($row['type'])==6 {echo "6m bits";}

but as i'm calling the database 10 times (to add all the components together i have $row $row1 $row[2''] ----$row9 how would i do the if statement with the ten $row[s] called?

I'm sorry if this is vague but i can't explain it much better!
Thank for looking

2
Contributors
1
Reply
3
Views
7 Years
Discussion Span
Last Post by zortec
0

You can use a switch/case for a problem such as this. Otherwise, I suggest using if and elseif statements to process the 10 rows.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.