- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- generating report using php
Operating System - Linux
1748150
Members
3516
Online
108758
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2006 05:22 PM
тАО10-15-2006 05:22 PM
generating report using php
Hi ,
Please give me some idea how to generate reports using php.
The query given to db is dynamic.i.e, the user may need any report which may not be excepted.
Thanks in advance
Hope I might get an idea for this from the group
Please give me some idea how to generate reports using php.
The query given to db is dynamic.i.e, the user may need any report which may not be excepted.
Thanks in advance
Hope I might get an idea for this from the group
- Tags:
- PHP
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2006 05:29 PM
тАО10-15-2006 05:29 PM
Re: generating report using php
You will have to make your first page which will give the user a set of reports you can run and post the form to another PHP program. Which will then run different SQL statements depending on the query user has selected and display it in anyway you like.
Let me know if you need more details about doing it
Let me know if you need more details about doing it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2006 06:11 PM
тАО10-15-2006 06:11 PM
Re: generating report using php
Hi Rajeev,
Your idea is ok ,but I am struck up in ,how to generate different queries automatically with out hardcoding it?
Thanks
Rekha
Your idea is ok ,but I am struck up in ,how to generate different queries automatically with out hardcoding it?
Thanks
Rekha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2006 04:35 AM
тАО10-16-2006 04:35 AM
Re: generating report using php
Sasirekha, its been a while since I've done any advanced SQL queries or worked with PHP, so I can't tell you the exact syntax, but there are numerous ways this can be pulled off and I can at least describe it in a logical method.
Remember your SQL query is basically just a string, and the easiest way to assemble it is using a string variable. I have seen a dynamic reporting system that uses a front loader screen where you check all the fields you want reported, then hit submit.
One example: Setup a front form page, with a dropdown to select which SQL table you want to query. That refreshes the screen and brings up a list of check boxes, one to represent each field in that table. You can also have a radio button or a dropdown, however you want to handle it, to deal with the SORT feature, as well as a text box next to each field's check box for a text match.
Using the GET or POST, gather the data submitted. Say Last Name, Department, Phone Number and Address were checked from the Table named Directory, and you put "David" in the text box at Last Name
Each of those check boxes would represent a single field in the SQL database.
If you are any good at string manipulation, it should be fairly simple to convert all that data into one long string, where your end result is
"select Last_Name Departmet Phone_Number from Directory where Last_Name='David'"
If this is for technical users who may actually be able to handle SQL queries, you can even have this data refreshed in real time into a text box, so if the user wants to make a small change that isn't anticipated by your form, they can do it directly. All that would be passed is that text box in the end. Even for the non technical users, this would be the method I recommend because you pass less data thru the form's POST. Just set the text box to hidden for non technical users.
What you plan on doing may be vastly different from this, but the underlying concept is generally the same. Use string manipulation / general variable manipulation to convert the form data into a workable SQL query.
You can also implement security on this, such as only members of HR can access the Directory table, and only Admins can see the SSN field, but it requires more work on both the PHP scripting and SQL server side.
Hope this helps, if you have any questions just post and I'm sure someone can answer them.
Remember your SQL query is basically just a string, and the easiest way to assemble it is using a string variable. I have seen a dynamic reporting system that uses a front loader screen where you check all the fields you want reported, then hit submit.
One example: Setup a front form page, with a dropdown to select which SQL table you want to query. That refreshes the screen and brings up a list of check boxes, one to represent each field in that table. You can also have a radio button or a dropdown, however you want to handle it, to deal with the SORT feature, as well as a text box next to each field's check box for a text match.
Using the GET or POST, gather the data submitted. Say Last Name, Department, Phone Number and Address were checked from the Table named Directory, and you put "David" in the text box at Last Name
Each of those check boxes would represent a single field in the SQL database.
If you are any good at string manipulation, it should be fairly simple to convert all that data into one long string, where your end result is
"select Last_Name Departmet Phone_Number from Directory where Last_Name='David'"
If this is for technical users who may actually be able to handle SQL queries, you can even have this data refreshed in real time into a text box, so if the user wants to make a small change that isn't anticipated by your form, they can do it directly. All that would be passed is that text box in the end. Even for the non technical users, this would be the method I recommend because you pass less data thru the form's POST. Just set the text box to hidden for non technical users.
What you plan on doing may be vastly different from this, but the underlying concept is generally the same. Use string manipulation / general variable manipulation to convert the form data into a workable SQL query.
You can also implement security on this, such as only members of HR can access the Directory table, and only Admins can see the SSN field, but it requires more work on both the PHP scripting and SQL server side.
Hope this helps, if you have any questions just post and I'm sure someone can answer them.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP