close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Coupon option list

Thread began 10/13/2010 12:53 am by kenstites342105 | Last modified 11/03/2010 2:39 am by kenstites342105 | 561 views | 3 replies

kenstites342105

Coupon option list

My Client wants to have a drop down list for Coupons that can be selectes in the shopping cart. I made a new recordset called PowerStoreCoupons and have added an option field in place of the text field. However, the list is only being populated with the first record.

index.php



I have tried this out on a blank page and it works ok, but is not working on cart.php page. Can anyone see what I have wrong here?

Thanks so much,
Ken

Recordset:
mysql_select_db($database_PowerStoreConnection, $PowerStoreConnection);
$query_PowerStoreCoupons = "SELECT ps3_coupons.CouponID, ps3_coupons.CouponCode, ps3_coupons.CouponIsLive FROM ps3_coupons WHERE ps3_coupons.CouponIsLive = 1 ORDER BY ps3_coupons.CouponCode";
$PowerStoreCoupons = mysql_query($query_PowerStoreCoupons, $PowerStoreConnection) or die(mysql_error());
$row_PowerStoreCoupons = mysql_fetch_assoc($PowerStoreCoupons);
$totalRows_PowerStoreCoupons = mysql_num_rows($PowerStoreCoupons);

<span style="float:left"><h2>Coupon Code:&nbsp;
<select name="CID" id="CID">
<?php
do {
?>
<option value="<?php echo $row_PowerStoreCoupons['CouponCode']?>"<?php if (!(strcmp($row_PowerStoreCoupons['CouponCode'], $row_PowerStoreCoupons['CouponCode']))) {echo "selected=\"selected\"";} ?>><?php echo $row_PowerStoreCoupons['CouponCode']?></option>
<?php
} while ($row_PowerStoreCoupons = mysql_fetch_assoc($PowerStoreCoupons));
$rows = mysql_num_rows($PowerStoreCoupons);
if($rows > 0) {
mysql_data_seek($PowerStoreCoupons, 0);
$row_PowerStoreCoupons = mysql_fetch_assoc($PowerStoreCoupons);
}
?>
</select>
</h2>
</span>

Attached Files
cart.zip

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...