Hi

I have a simple Table (Table1) with 3 fields (ID, Date, Value).

So if I query the DB for a certain date it lists the ID and value of all rows with that date. What I need to do is have a checkbox next to each table row and only the ID & Value of the rows that are checked should be posted to the next page where I will do a SUM to add the values together.

Does anyone have any ideas on the best way to do this?

Thanks in advance

Member Avatar for diafol

A few ways to go with this.
You can check for individual checkboxes and get their id values. You could then requery the db with a more complicated WHERE clause (filter).

I'm no expert, but I think you can do this for complicated WHERE clauses:

... WHERE my_id IN (1, 2, 5, 8, 12)

Where the numbers in parentheses are you returned id values ($_POST). Just build up the string with a simple while or for loop.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.