I am using the 'odbc_' funtions to work with a database.
The results I get from a query are moved into a variable called $results and contain the following:
TYPE HOURS RATE TOTAL
personal 8 5.25 42
regular 24 5.25 126
sick 8 5.25 42
Basically, this is data pulled from a paycheck details table.
What I want to do is output results of the query onto the page in a column format with some space in between each column to display exactly how I gave the above example. Additionally, I want to be able to loop through the results and add the values to get individual column totals for all rows returned.
Are the results that I move into $results an array or do I need to somehow put them in an array and then echo out the results of the array? I ran into the issue when trying to return the row count and getting back -1 but found a post with a function to handle that. It just seems like I need to be using a combination of array funtions and loops to get the data out.
I can provide further information if needed. Thanks in advance for any suggestions.
The results I get from a query are moved into a variable called $results and contain the following:
TYPE HOURS RATE TOTAL
personal 8 5.25 42
regular 24 5.25 126
sick 8 5.25 42
Basically, this is data pulled from a paycheck details table.
What I want to do is output results of the query onto the page in a column format with some space in between each column to display exactly how I gave the above example. Additionally, I want to be able to loop through the results and add the values to get individual column totals for all rows returned.
Are the results that I move into $results an array or do I need to somehow put them in an array and then echo out the results of the array? I ran into the issue when trying to return the row count and getting back -1 but found a post with a function to handle that. It just seems like I need to be using a combination of array funtions and loops to get the data out.
I can provide further information if needed. Thanks in advance for any suggestions.