Welcome Guest, Not a member yet? Register   Sign In
Gathering data BASED on already gathered data?
#6

[eluser]kgill[/eluser]
What exactly are you confused about, joins or the code I posted? Joins: read up on them and if you still don't get it after you've researched them then ask for help. The code: that's just an example of how to deal with the fact that the some of the data for each list will appear multiple times.

Queries with joins return data like the example I showed up there, but most people want their data like this:

Code:
list1  entry1
       entry2
       entry3
list2  entry1
       entry2
list3  entry1
       entry2

which isn't going to happen - hence the need to rewrite your logic a bit to deal with how data does come back. I just noticed you're using objects and not arrays so that might be part of what is confusing you, $row->name would be the same as $row['name'] if you were using arrays. As for adapting it to your situation, that's your job - the best way to learn this stuff is to try it yourself and experiment to see what comes out when you do something.


Messages In This Thread
Gathering data BASED on already gathered data? - by El Forum - 06-18-2009, 10:26 PM
Gathering data BASED on already gathered data? - by El Forum - 06-18-2009, 10:46 PM
Gathering data BASED on already gathered data? - by El Forum - 06-18-2009, 10:50 PM
Gathering data BASED on already gathered data? - by El Forum - 06-18-2009, 10:55 PM
Gathering data BASED on already gathered data? - by El Forum - 06-18-2009, 11:06 PM
Gathering data BASED on already gathered data? - by El Forum - 06-18-2009, 11:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB