how to assign and concat using multiple delimiters in an array?
<p>i apologize if the question is wrong. i am a still a newbie and a learner however i would appreciate if someone correct me if i am somewhere wrong.</p>

<p>here in the Class method i am using for Inserting the data into the database</p>

<pre><code>public funtion insert($table,$col,$value)
{
    if(is_array($col) &amp;&amp; is_array($value))
    {
        $query = "INSERT INTO ".$table."(" . implode(",",$col) . ") VALUES(" . implode(",",$value) . ")";
    }
    else
    {
        $query = "INSERT INTO " . $table . "(" . $col . ") VALUES(". $value . ")";
    }
}
</code></pre>

<p>now here i am determining if the $col and $value is an array if yes then process it.</p>

<p>however i have a problem here since the VALUES in the Insert statement needs to be represnted in the single or double quote format it will not process the query and hence print the error</p>

<p>for example the below code would print the error</p>

<pre><code>$query = "INSERT INTO users(username,email) VALUES(test,test@test.com)";
</code></pre>

<p>and the correct format will be</p>

<pre><code>$query = "INSERT INTO users(username,email) VALUES('test','test@test.com')";
</code></pre>

<p>now in the col value i would like to add the single quotes to every value in the array for example the $value array which is like this.</p>

<p>$value = array('test','test@test.com');</p>

<p>should give back the value</p>

<p>'test','test@test.com'</p>

<p>instead oof </p>

<p>test,test@test.com</p>

<p>how do i achieve it?</p>

<p>thank you?</p>
