Welcome Guest, Not a member yet? Register   Sign In
insert whit select
#1

[eluser]Unknown[/eluser]
hi, is posible do this with CI?

INSERT INTO table (col1, col2) SELECT col3, col4 FROM table2;
#2

[eluser]GSV Sleeper Service[/eluser]
er, yes.
Code:
$sql = "INSERT INTO table (col1, col2) SELECT col3, col4 FROM table2";
$this->db->query($sql);




Theme © iAndrew 2016 - Forum software by © MyBB