I have array
Array
(
[0] => john
[1] => melinda
)
And have database table
|id|name|
How I can insert the name into my database using php?
I can do using looping on mysql_query, but it not good for my resource.
the code I made now is
foreach( $data as $row ) {
mysql_query("INSERT INTO badwords (word) VALUES('".$row."')");
}
it work but I think there is another simple way.
Thank you