Okay… not difficult, I know, but I can’t figure it out! I’ve got a Select statement in PHP. It only selects one field, but I cannot get that one field into PHP as a variable. It’s just the one and it’s been selected… how do I use it now?
@dz_boyauthorAug 16.2007 — #I have customers in a SQL table, and they all have unique customer id numbers. Each customer can join several different groups, which also have unique id numbers. I have a table with just a group id column and a customer id column. If said customer is part of two groups, my "select group id where customer id =X" statement in PHP for the database will return two records. Does the method you posted earlier work even if the field name in the $row[' '] will be the same for both returned records?
I guess my question is how can I return two records from the same column in the table. I'm sorry this was put so confusingly.
@dz_boyauthorAug 16.2007 — #Can that loop be used to store each group id in a separate variable, rather than print it? So if a user is a member of 3 groups, can a variable be set for each of the three that way? I ask this because it seems as if you just changed the echo statement to assign the variable, that same variable name would be used and therefore overwrite itself each time the loop executed. Am I wrong? Sorry for the questions... I'm very new at this.
Will this store each item_id in a separate variable? I won't be able to control how many item_ids there are at any given time, so a loop of some kind will be needed, right? My goal, once I have stored all the item_id's, is to use them to reference another table with more information about each item. Any thoughts?