CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Checkboxes with dynamic mysql data

Print topic Send  topic

Author Message
goatmilk

Posts: 10
Posted: 08/18/2008, 6:00 AM

Hi All

First of all, awesome software! Stumbled upon it while looking for dependant dropdown solution.

Hoping someone can help or point me in the right direction ...

I have 3 tables:
table1 contains products
table2 contains catalogues
Each catalogue can contain multiple products, so
table3 is used to link table1 & table2 via id's.

The end result that users see looks something like this ...

--------------- catalogue1 catalogue2 catalogue3
product 1
product 2
product 3
product ...

I want to add a checkbox to each catalogue/product combination to allow users to select which products from which catalogue they would like. Once they have made their selections there is a submit button they can click on which will take them to a page that only shows the selections they have made.

My question is how can I link the checkboxes to the various catalogue/product combinations?

Any help is much appreciated!
View profile  Send private message
datadoit
Posted: 08/18/2008, 7:13 AM

Welcome aboard.

To kind of get you started, download the example packs. They'll contain
a sampling of various techniques, and perhaps with bits and pieces from
them you can find what you're looking for.
goatmilk

Posts: 10
Posted: 08/18/2008, 3:20 PM

Thanks for the reply. i had a look through the example packs but still fail to find what I'm looking for.

I guess the first part to start at is figuring out how to set the checked values of checkboxes to a value from mysql database :-/
View profile  Send private message
wkempees


Posts: 1679
Posted: 08/20/2008, 8:48 AM

Goatmilk........I had some spare time......
There are more problems in your question than you can see at this moment.
How many catalogues do you allow for?
How many product are there?

The first page shown to your user would be a (matrix- difficult in itself) grid showing all possible combinations running on table_3 with a lookup for productname.
If you want to try that, you would have the grid display the table_3 ID field only in the columns while at the same time displaying the productname per row (column1).
If you have a varying number of catalogs, it will be a (nice) challenge to place the ID in the right catalogue column (adding columns on the fly and catering for maximum screen size).

The second challenge would be to transform the ID's to checkboxes, all unchecked and give the user the opportunity to change them to checked (or unchecked).
In this case we are no longer talking grids but editable grids, because of the update action.
(Grids by default show records and allow for linking values to the next page, but do not cater for updating).
This editable grid however will not function as you intend to, because we do not want to update table_3..........

Then the next challenge will be to have the editable grid store the selected checkboxes and redirect to the Show product per catalog page.

Although I envisage this to be ultimately possible, I would advise against this when evaluating the Tool CodeChargeStudio.........

However, it can be done using some trickery.
I would create a new table (table4) a copy of table_3 but in it it will have some userid, either because of login or just a sequence number or sessionid (for not logged in passerby's).
You would then have some sort of editable grid, only allowing update.
Prefill this table_4 with data from table_3 enriched with the userid, Before Show.
The editable grid could then show all the unchecked boxes, allow for checking/unchecking.
It could pass the userid as a parameter on the redirect (triggered by some button) to the product per catalog page and use table_4 as its filter.

Lot of text, lot of work, might overstep your evaluation time limit!

But principally can be done.

Walter

_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
goatmilk

Posts: 10
Posted: 08/21/2008, 10:14 PM

Thanks for the reply wkempees. Yeah, it will take quite a while to do with CCS4. I did purchase the personal edition because this is such awesome software!

To solve my problem I'm designing the frontend with dreamweaver using arrays, loops, etc while using CCS4 for the backend management. I'll let you know how I go.

Cheers!
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.