[PHP] php/mysql data display
I have a small database that I want to display data from. in such a way that it shows shows in a table with the table header being the department category and the table cells being the categories for each department. I have no problem connecting to the database) I imagine that I will need nested loops, but I haven't seen a tutorial showing quite what I am looking for. If anyone can point me in the right direction that would be great. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php/mysql data display
[snip] I have a small database that I want to display data from. in such a way that it shows shows in a table with the table header being the department category and the table cells being the categories for each department. I have no problem connecting to the database) I imagine that I will need nested loops, but I haven't seen a tutorial showing quite what I am looking for. If anyone can point me in the right direction that would be great. [/snip] Probably just a good query would do. Show us some data in its storage format and then show us an example of what you want the output to be. We can then go from A to B. Until then your question is rather vague. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php/mysql data display
Data is as such right now for testing purposes: ID, catName, catLink, catDepartment. I will have multiple instances of the same text in catDepartment. I realize this is a fopaux. I'm just trying to do a quick fix. none the less I want the data formatted like this: DEPARTMENT NAME 1(catDepartment) DEPARTMENT NAME...n(catDepartment) - Category1(catName) Category1(catName) Category2(catName) Category2(catName) Category...n(catName) Category...n(catName) hopefully this makes things less vague. Thanks, J. "Jay Blanchard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [snip] I have a small database that I want to display data from. in such a way that it shows shows in a table with the table header being the department category and the table cells being the categories for each department. I have no problem connecting to the database) I imagine that I will need nested loops, but I haven't seen a tutorial showing quite what I am looking for. If anyone can point me in the right direction that would be great. [/snip] Probably just a good query would do. Show us some data in its storage format and then show us an example of what you want the output to be. We can then go from A to B. Until then your question is rather vague. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php/mysql data display
[snip] Data is as such right now for testing purposes: ID, catName, catLink, catDepartment. I will have multiple instances of the same text in catDepartment. I realize this is a fopaux. I'm just trying to do a quick fix. none the less I want the data formatted like this: DEPARTMENT NAME 1(catDepartment) DEPARTMENT NAME...n(catDepartment) - Category1(catName) Category1(catName) Category2(catName) Category2(catName) Category...n(catName) Category...n(catName) [/snip] You need a crosstab query in SQL. Please search google for "crosstab query". -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php