I have problems writing one query. For example, I have table with fields id and name which looks like
ID | Name
---+------
1 | John
2 | Ben
3 | Bob
And second table with fields name and somefield. I need to populate this table using data from first one so it looks like
name | somefield
-----+-----------
John | blah=1
Ben | blah=2
Bob | blah=3
So, value of name is name from first table and value of somefield is some phrase like blah=+id value from 1st table. Is this possible with just mysql ? I tried to do this using loop and wp wpdb class but wpdb kept throwing some malloc (i think) error after ~ each 30 row
INSERT INTO table2 SELECT Name,CONCAT('blah=',ID) FROM table1;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With