Hello, I ran into a problem and just can not solve it.

There is a database table, it has 2 fields: NAME and PRICE (in it, for example, two products). I need to first display both names and then put them again in the table, but in the other, which also contains the fields: NAME and DATE.

The problem is that I cannot add the names of the goods from the first one to the second table. For example, I have an array with the names $row["name"] and I don’t know what to do to add TWO LINES to the second table, each with a name.

    2 answers 2

     INSERT INTO table_name2 (name, data) SELECT name, NOW() from table_name WHERE критерий_отбора 

    You can somehow like for example

      complete the request

       "INSERT INTO table_name (name) Value (".name1."),(".name2.")";