How to take all rows in a table, by value and record these values separated by a comma in another table?

Good afternoon.

Please tell me how I can take all the values of `id` from the basket_items table and record them in column `items` table basket_orders ?

For example:
SELECT `id` FROM `basket_items` WHERE `user` = {$id}


In return to put all id's separated by commas, then to make insert in other table (column) ?
Please tell me.
June 14th 19 at 20:29
1 answer
June 14th 19 at 20:31
Solution
implode — joins the array elements into a string

php.net/manual/ru/function.implode.php
She tried, at me why-that the base is not ajtishniki written, and the words Array, Array, Array, Array - celestine.Hoppe commented on June 14th 19 at 20:34
What can be the reason ? - celestine.Hoppe commented on June 14th 19 at 20:37
so what you're trying to merge into a string array, not a rowset
If you show me the code would be clearer - Elinor_Dool commented on June 14th 19 at 20:40

Find more questions by tags MySQLPHP