ID:2050387
 
(See the best response by Ter13.)
Code:
    var/database/query/q = new("SELECT item_id FROM Player_Inventory WHERE byond_key = ?", byond_key)
var/list/row
if(q.Execute(db))
while(q.NextRow())
row += q.GetRowData()
return row


Problem description:
So I have a database query returning multiple rows of results.

I am them looping through collecting the row data.


In the end I am printing out the results like this:
world << list2params[row] //This is the returned value


I am expecting to see:
item_id=5&item_id=6&item_id=7

What I am seeing is:
item_id=7&item_id=7&item_id=7

This has to be the mistake but I am not getting what I am doing wrong.
row += q.GetRowData()
EDIT: Nevermind.

Can you show the actual query you are performing?
In response to Ter13
Ter13 wrote:
EDIT: Nevermind.

Can you show the actual query you are performing?
Updated

If I world << in the while loop the correct values are coming across.
Best response
Oh. I see. The problem is that you are adding associative indices to the list. You can't add the same associative index to a list multiple times.
In response to Ter13
Ter13 wrote:
Oh. I see. The problem is that you are adding associative indices to the list. You can't add the same associative index to a list multiple times.

Ah that makes sense. So I would need to parse out the item_id before I added it to the list. That makes sense. Thanks for the help.