|
If row contains certain value then = a number
I am a total newbie at php. I have a script I am working with and need to change the way something works.
Basically I need this script to look at the value of a certain column in a row and depending on what it is turn it into a number value.
The column I am working with is called 'shippingsvc'. It will have one of these four values in it:
Standard Shipping
Local Pickup
Free Shipping
Economy Shipping
So if the value is "Standard Shipping" I would like it to bring back '125'.
If it is "Local Pickup" = '126'
If it is "Free" = '127'
If it is "Economy Shipping" = '128'
I know this code below will probably not work but it might give you an idea of what I am looking to do.
if($row['shippingsvc']="Standard Shipping" {$shippingservice='125';}
if($row['shippingsvc']="Local Pickup" {$shippingservice='126';}
if($row['shippingsvc']="Free Shipping" {$shippingservice='127';}
if($row['shippingsvc']="Economy Shipping" {$shippingservice='128';}
I would appreciate any help.
|