I'm a PHP newbie, I need to assign query results to variables that have an incrementing number in the variable name, can someone help me with this?
So let say I return a few rows of from MySQL, I would like loop though the results and assign the values to variables with incrementing numbers like the following:
while($row1 = mysql_fetch_assoc($result1)) {
$sku_1 = row1["sku"];
$quantity_1 = row1["quantity"];
};
where 1 is the incrementing
I eventually need to put these results into a URL like this
&sku_1=1234&quantity_1=1
&sku_2=1235&quantity_2=1
&sku_3=1236&quantity_3=2
Thanks,
Marc