I am having a problem of inserting an associative array into a database.
For example I want to replicate
however with an associative array I cannot do this it seems to enter it into a database on multiple rows as opposed to one row.
I've tried doing
Any ideas?
For example I want to replicate
Code:
INSERT INTO table (value, value2, value3) VALUES ("1", "2", "3");
however with an associative array I cannot do this it seems to enter it into a database on multiple rows as opposed to one row.
I've tried doing
PHP:
foreach($array as $k => $v){
mysql_query("INSERT INTO table ({$k}) VALUES ({$v})");
}
Any ideas?