Soldato
- Joined
- 22 Aug 2005
- Posts
- 8,971
- Location
- Clydebank
Hi.
I've got a simple crud system working for a simple (1 table, 3 column) database i have setup using PHP and mysql.
This is based on 4 files, new.php, edit.php, list.php and delete.php
Now I have list.php working nicely, pagination, records per page etc for a simple hard coded "SELECT * FROM `main_table` ORDER BY id DESC LIMIT $start_from, $records_per_page" but I now I am trying to write some reporting functionality and I would like to simply use the same list.php to list the results of the mySQL query. I have my user choose the reports from another page named report.php
But the question is how do I get different mysql queries into the list.php file? As far as I can see the main methods of passing info are via GET and POST.
Is it really sensible to POST the SQL query to the list.php form? Is this how it's done?
Cheers all.
I've got a simple crud system working for a simple (1 table, 3 column) database i have setup using PHP and mysql.
This is based on 4 files, new.php, edit.php, list.php and delete.php
Now I have list.php working nicely, pagination, records per page etc for a simple hard coded "SELECT * FROM `main_table` ORDER BY id DESC LIMIT $start_from, $records_per_page" but I now I am trying to write some reporting functionality and I would like to simply use the same list.php to list the results of the mySQL query. I have my user choose the reports from another page named report.php
But the question is how do I get different mysql queries into the list.php file? As far as I can see the main methods of passing info are via GET and POST.
Is it really sensible to POST the SQL query to the list.php form? Is this how it's done?
Cheers all.