title: convert array to string error
body: <p>im a noob using codeigniter and coding php, my question is that i have an error..
  im trying to store the data from my form but the error is hindering me..</p>
  
  <pre><code> A PHP Error was encountered
  
  Severity: Notice
  
  Message: Array to string conversion
  
  Filename: mysql/mysql_driver.php
  
  Line Number: 589
  </code></pre>
  
  <p>and a data base error:</p>
  
  <pre><code>Error Number: 1064
  
  You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Array' at line 1
  
  INSERT INTO `grade1` () VALUES ('7'), Array
  
  Filename: C:\wamp\www\thisisit\system\database\DB_driver.php
  
  Line Number: 330
  </code></pre>
  
  <p>here is my view:</p>
  
  <pre><code>    &lt;form action="&lt;?php echo site_url('contrl/firstgrading') ?&gt;" method="post"&gt;
      &lt;strong&gt;&lt;input type="hidden" id="sid[]" name="sid[]" value="&lt;?php echo $sid ?&gt;"&gt;&lt;?php echo $fname." ".$mname." ".$lname ?&gt;&lt;/strong&gt;&lt;br&gt;
          &lt;?php                
                            $this-&gt;load-&gt;database();          
                            $query = $this-&gt;db-&gt;query("SELECT subid,subjectname FROM subjects ");           
                            foreach ($query-&gt;result_array() as $row)
                             {
                          ?&gt;
                              &lt;tr&gt;
                                  &lt;td&gt;&lt;input type="hidden" id="subid[]" name="subid[]" value="&lt;?php echo $row['subid'] ?&gt;"&gt;&lt;?php echo $row['subjectname']?&gt;&lt;/td&gt;                        
                                  &lt;td align="center"&gt; &lt;input class="form-control" id="GFirst[]" name="GFirst[]" type="text"&gt;&lt;/td&gt;
                                  &lt;td align="center"&gt; &lt;input class="form-control" id="GSecond[]" name="GSecond[]" type="text"&gt;&lt;/td&gt;
                                  &lt;td align="center"&gt; &lt;input class="form-control" id="GThird[]" name="GThird[]" type="text"&gt;&lt;/td&gt;
                                  &lt;td align="center"&gt; &lt;input class="form-control" id="GFourth[]" name="GFourth[]" type="text"&gt;&lt;/td&gt;
                                  &lt;td align="center"&gt; &lt;input class="form-control" id="GFinal[]" name="GFinal[]" type="text"&gt;&lt;/td&gt;                                                                                                            
                              &lt;/tr&gt;                      
                          &lt;?php
                            }
                          ?&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>this is my controller:</p>
  
  <pre><code>    $temp = array();
              $temp = $this-&gt;input-&gt;post(NULL, TRUE);        
              for($i = 0 ; $i &lt; count($this-&gt;input-&gt;post('subid')); $i++){            
                  $temp[] = array(
                          'gradeid'           =&gt; '0',
                          'firstgrading'      =&gt; $temp['GFirst'][$i],
                          'secondgrading'     =&gt; $temp['GSecond'][$i],
                          'thirdgrading'      =&gt; $temp['GThird'][$i],
                          'fourthgrading'     =&gt; $temp['GFourth'][$i],
                          'finalgrading'      =&gt; $temp['GFinal'][$i],
                          'subidLink'         =&gt; $temp['subid'][$i],
                          'studidLink'        =&gt; $temp['sid']
                      );
              };
              $this-&gt;load-&gt;model('model');
              $this-&gt;model-&gt;grade($temp);            
  </code></pre>
  
  <p>this is my model:</p>
  
  <pre><code>function grade($array = NULL)
          {
              if(!isset($array) || !is_array($array)) return FALSE;
              $confirm = $this-&gt;db-&gt;insert_batch('grade1',$array);
              if($confirm)
              {
                  echo "Success";
              }
              else
              {
                  echo "Fail";
              }
          }
  </code></pre>