I'll give the obliged, "I'm pretty new to PHP , so this is probably a simple question..."
I need to print/output a table of data, with user names along y-axis and data fields names along x. The data is stored in a row that includes: username, sessionnum, pagenum, formname and fieldnum. I'm a Java programmer, and I'm finding PHP arrays very unintuitive, especially when you throw in the mysql commands. I solved the problem algorithmically, but in implementation odd things (to me at least) seem to happen. For example, if I try to call a while($row = mysql_fetch_array($data)){... nested within a foreach, I get duplicate data , without the iterator moving through the array. When I run the while call not nested, the results are as expected. I KNOW there is a relatively simple and elegant way to do this, but I keep thinking in Java, which is not helping- and of course I don't have a week to read a PHP book thoroughly.
Thanks.
Data reporting problem
Moderator: General Moderators
Re: Data reporting problem
You should start by posting the code and pointing out where you think are your problems
-
limitdesigns
- Forum Commoner
- Posts: 25
- Joined: Sat Feb 06, 2010 9:05 pm
Re: Data reporting problem
Without knowing your exact code, I'm guessing your query is returning duplicate rows because you're joining tables without using SELECT DISTINCT * .