Skip to main content
JBWebWorks
Inspiring
May 15, 2011
Question

help with php code

  • May 15, 2011
  • 1 reply
  • 482 views

Using DW CS4

Have a page with a select that is populated from a recordset that lists products and i am trying to have the select show certain products as being SOLD OUT!

Here is the code i have

<?php /*START_PHP_SIRFCIT*/ if ($row_rs_options['OptionPriceincrement']!="0"){ ?>

           <option value="<?php echo $row_rs_options['ProductOptionID']?>"><?php echo $row_rs_options['OptionName']?> $<?php echo $row_rs_options['OptionPriceincrement']; ?></option><?php } else echo'<option class="style1" value=""><?php echo $row_rs_options[\'OptionName\']?> ITEM SOLD OUT!</option>' /*END_PHP_SIRFCIT*/ ?>

If my else statement is triggered, i want the select option to show the OptionName where the OptionPriceincrement is == to 0 and also the text ITEM SOLD OUT!

With the code as i have it, only the ITEM SOLD OUT! shows in a browser.

You can see this here http://www.comfycampers.info/products.php

Go to Tour Bon Ton Roulet and view the select

thanks for your help,

-Jim Balthrop

This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

JBWebWorks
Inspiring
May 16, 2011

I figured out my mistake on the code.

<?php /*START_PHP_SIRFCIT*/ if ($row_rs_options['OptionPriceincrement']!="0"){ ?>
            <option value="<?php echo $row_rs_options['ProductOptionID']?>"><?php echo $row_rs_options['OptionName']?> $<?php echo $row_rs_options['OptionPriceincrement']; ?></option><?php }

else { ?><option class="style1" value=""><?php echo $row_rs_options['OptionName']; ?> SOLD OUT!</option>

<?php } /*END_PHP_SIRFCIT*/ ?>

You can see this here http://www.comfycampers.info/products.php

Go to Tour Bon Ton Roulet and view the select

thanks for your help,

-Jim Balthrop