Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

help with php code

Participant ,
May 15, 2011 May 15, 2011

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

TOPICS
Server side applications
480
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 16, 2011 May 16, 2011
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines