I'm using codeigniter, and I have a large table with a lot of columns that I want to insert large amount of data into. Is there a better approach than writing the name if each column, and then the value that will be inserted in each column. For example, a php function that gets the table columns and put them in an array, and have another array that have the values pointing to each column...
Example with codeigniter:
$data = array('column_name1'=>'value1', 'column_name2' =>'value2'....);
$this->db->insert('table_name', $data);
Regular php
mysql_query("INSERT INTO table_name (column_name1, column_name2) VALUES ("Value1"....)");