close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Featured Item on home page

Thread began 11/21/2009 2:17 pm by pete268226 | Last modified 11/24/2009 8:47 pm by pete268226 | 889 views | 3 replies


Featured Item on home page

In my last post, I was able to ask about and create an automated query that updates the content of the div to the latest updated product.

Having done that, I'm having some trouble with the logic for this idea:

In the left div on the home page, where there is a featured product, I'd like to add an option to the Product_Update.php and Product_Insert.php pages to make this a featured item.

My Progress So Far:
I have added a TinyInt column to my db with a default value of '0'. I called it ProductFeature.

I created the checkbox element in the form above the Available Online question. I then adjusted the update server behaviours. The code I used is:

<label for="ProductFeature" class="readonly-checkbox">Featured Product?</label>
<input <?php if (!(strcmp(((isset($_POST["ProductFeature"]))?$_POST["ProductFeature"]:""),1))) {echo "checked=\"checked\"";} ?> name="ProductFeature" type="checkbox" id="ProductFeature" value="1" /> (check to make this item a Feature on the home page)

The db is being updated properly with a value of 1 or 0.

Now, here's my difficulty: How do I apply the following logic?

"There is only one row that is allowed to be a Featured Product (ProductFeature=1). When I make a new product a featured-product, the previous featured-product must change its ProductFeature value from 1 to 0; then the new featured-product information (retaining the ProductFeature=1 value) will be called to the div on the home page."


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





Ease of use


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...