I often have large arrays, or large amounts of dynamic data in PHP that I need to run MySQL queries to handle.
Is there a better way to run many processes like INSERT or UPDATE without looping through the information to be INSERT-ed or UPDATE-ed?
Example (I didn't use prepared statement for brevity sake):
$myArray = array('apple','orange','grape'); foreach($myArray as $arrayFruit) { $query = "INSERT INTO `Fruits` (`FruitName`) VALUES ('" . $arrayFruit . "')"; mysql_query($query, $connection); }