title: Cannot modify an external database in Joomla! 3.0.3. using php request
body: <p>I have been creating a website on my local server with Joomla! 3.0.3.
  I have successfully connected an external database to this website and can query it (see previous question of mine: <a href="https://stackoverflow.com/questions/15670555/where-statement-not-working-in-joomla-3-0-3-php-request">WHERE statement not working in Joomla! 3.0.3. php request</a>). But when I try to modify an entry in my external database, the server returns an error screen.</p>
  
  <p>Here's the code I'm using in the back end of Joomla! (using the Sourcerer extension). I try to add a new currency to a MySQL "currency" table in my external database.</p>
  
  <pre><code>&lt;?php
  
  /**///////// LOAD EXTERNAL DATABASE (i.e. not the Joomla one) /////////**/
  
  $option = array();
  $option['driver'] = 'mysql'; // Database driver name
  $option['host'] = 'localhost'; // Database host name
  $option['user'] = 'root'; // User for database authentication
  $option['password'] = ''; // Password for database authentication
  $option['database'] = 'externaldatabase'; // Database name
  $db = JDatabase::getInstance( $option );
  /**///////// CREATE NEW QUERY OBJECT /////////**/
  
  $query = $db-&gt;getQuery(true); //OK
  /**///////// SELECT RECORDS &amp; INSERT A NEW ROW /////////**/
  
  $columns=array('ID', 'CurrencyCode', 'FullName');
  $values=array('3', 'GBP', 'Pound Sterling');
  $query-&gt;insert($db-&gt;quoteName('currency'));
  $query-&gt;columns($db-&gt;quoteName($columns));
  $query-&gt;values(implode(',', $values);
  
  /**///////// RESET QUERY /////////**/
  
  $db-&gt;setQuery($query); //OK
  
  try {
      $result = $db-&gt;execute();
  } catch (Exception $e) {
      // catch
  }
  ?&gt;
  </code></pre>
  
  <p>The browser returns the following two errors:</p>
  
  <ul>
  <li><strong>Parse error</strong>: syntax error, unexpected ';' in C:\wamp\www\plugins\system\sourcerer\helper.php(450) : runtime-created function on line 46</li>
  <li><strong>Fatal error</strong>: Function name must be a string in C:\wamp\www\plugins\system\sourcerer\helper.php on line 454</li>
  </ul>
  
  <p>Do you have any suggestion? Thanks in advance for your help.</p>
  
  <hr>
  
  <p>Here's the updated code that's working for those of you interested!</p>
  
  <pre><code>&lt;?php
  $values=array('3', '"GBP"', '"Pound Sterling"');
  $query-&gt;insert($db-&gt;quoteName('currency'));
  $query-&gt;columns($db-&gt;quoteName($columns));
  $query-&gt;values(implode(',', $values)**)**;
  ?&gt;
  </code></pre>