function ImplodeGetItems()
{
$sql = mysql_query('SELECT TYPE FROM _cart WHERE cookieID="' .GetCartID(). '"');
$array = mysql_fetch_array($sql);
$implode = implode(",",$array);
$types = $implode;
echo $types;
}
What it's doing is pulling the array, but not doing exactly what I intend it to do. I need it to take all rows and from the TYPE column in the database table where the cookieID = the customer ID.
That column contains only numbers ranging from 1 to 3, and each item in the cart will have it's one row in the database.
If a customer adds 12 items to the cart, it will have 12 rows from the sql pull. I need to take all twelve rows for example and put them into one array using a comma delimiter.
row[0] = 1
row[1] = 3
row[2] = 2
row[3] = 3
row[4] = 1
row[5] = 2
row[6] = 2
row[7] = 1
row[8] = 1
row[9] = 1
row[10] = 2
row[11] = 3
If those are the results of the 12 rows, I need it to create a string array of:
$types = "1,3,2,3,1,2,2,1,1,1,2,3";
Thanks in advance,