Created
February 15, 2014 10:47
-
-
Save henry0312/9017553 to your computer and use it in GitHub Desktop.
Inserting multiple rows on FuelPHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function action_index() | |
{ | |
Model_Test::test(); exit; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function test() | |
{ | |
$query = \DB::insert('table_name') | |
->columns(array('col1', 'col2')); | |
$query->values(array('0', '1')); | |
$query->values(array('2', '3')); | |
$query->values(array('5', '4')); | |
$query->values(array('6', '7')); | |
Debug::dump($query->compile()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Variable #1: | |
(String): "INSERT INTO `table_name` (`col1`, `col2`) VALUES ('0', '1'), ('2', '3'), ('5', '4'), ('6', '7')" (95 characters) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment