Insert data to database using foreach loop php : <p>Ex: If I have code :</p>

<pre><code>$data = array('a','b','c');
foreach($data as $val){
mysql_query("INSERT INTO db (`title`)VALUES('$val')");
}
</code></pre>

<p>I want to insert all data from variable $val how can I coding it ? 
please help !!!
thank !! </p>
