Prepared Statement to place Multiple Rows into Variables
In my User Profiles, I have 10 Questions that Members may answer.
I have decided to model this as a many-to-many relationship where "answer" is the intermediary table between "member" and "question".
For each Member Profile, I need to display the responses to each Question in their Profile, but if I run a query like this...
Code:
SELECT response
FROM answer
WHERE member_id = 1;
Then all I will get is a query-set of 10 records like this...
Quote:
01 I started my own business because...
02 My advice to other entrepreneurs is to get a good lawyer!
:
:
10 I compete with large corporation by knowing my customers and giving exceptional service!
What I need - if possible - is to write a Prepared Statement that would take the 10 records returned - with just one Field - and store each respective record into a variable like $response1, $response2,... $response10 so that ONE QUERY can be used to populate my 10 Text Boxes on the "my_thoughts.php" page in their Profile.
(If I have to write 10 separate Prepared Statements - one for each Question - I will scream!!!) :mad:
Can this be done?
If so, how would I do it?
(I'm still not that strong with Prepared Statement, especially fancier things like this...) :(
Thanks,
Debbie