Thursday, 7 January 2016

How to insert multiple rows into mysql by a single query using codeigniter


mysql.png
Most of time we need to insert multiple rows at a time into the database but some developer use multiple INSERT statements to insert multiple rows while it is a bad approach to solve this problem. Codeigniter provides a insert batch function.

Example:-
$data = array(
array(
'title' => 'My title' ,
'name' => 'My Name' ,
'date' => 'My date'
),
array(
'title' => 'Another title' ,
'name' => 'Another Name' ,
'date' => 'Another date'
…….
……..
Read full blog at our highly specific C, Java, PHP, Javascript, iPhone, Mysql Questions, about the topic described above "How to insert multiple rows into mysql by a single query using codeigniter". You can also learn much more about different programming technologies and can enhance your tech skills.

No comments:

Post a Comment