I have 100 records in My DB.
I want to show 10 and then add another field in the record as UPDATE and then show these 10 as printer friendly.

Recommended Answers

All 3 Replies

Please suggest me, I can share my work

Very possible!
when user clicks generate button, you collect the checkboxed things and calculate whatever you calculate and dynamically creating a table as pointed in last image

Member Avatar for diafol

I assume you want to be able to select records via a form or list and then press 'Make Report' or similar. This page then appears and you can print it. Correct?

For this you need a payments table with a Primary Key (named payment_id) set as autoincrement.

Your original list for selecting is drawn from a DB. Each record will have a checkbox associated with it. The checkboxes should have values set to the payment id:

<input type="checkbox" id="include_<?php echo $row['payment_id'];?>" name="include[]" value="<?php echo $row['payment_id'];?>" /><label for ="include_<?php echo $row['payment_id'];?>">Include</label>

In your form handler page, you can extract the selected values.

Create an array out of the values (which are all valid payment_id values) and use that in your SELECT query.

This is the syntax:

SELECT "column_name"
FROM payments
WHERE payment_id IN ('value1', 'value2', ...)

This will return all the desired records.

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.