PDA

View Full Version : How can i select and insert with one query?


mohammad6006
04-17-2015, 01:01 PM
It is an example about SELECT from a table and INSERT to another table :

INSERT INTO Customers (CustomerName, Country)
SELECT SupplierName, Country FROM Suppliers;


How can I do that with VB DB class?

kh99
04-17-2015, 01:21 PM
You just need to use query_write (like $vbulletin->db->query_write()) and pass it a string with sql you want to use.