Skip to content

Commit

Permalink
fix variable name clashing and move assignment to the correct place
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.php.net/repository/pear/packages/MDB2/trunk@245983 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
quipo committed Nov 10, 2007
1 parent a11f31e commit e68e866
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions MDB2/Driver/pgsql.php
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ function getServerVersion($native = false)
* 'INSERT INTO numbers VALUES(:foo,:bar)'.
* The ? and :name and are placeholders which can be set using
* The allowed format for :name can be set with the 'bindname_format' option.
* bindParam() and the query can be send off using the execute() method.
* bindParam() and the query can be sent off using the execute() method.
*
* @param string $query the query to prepare
* @param mixed $types array that contains the types of the placeholders
Expand Down Expand Up @@ -868,15 +868,15 @@ function &prepare($query, $types = null, $result_types = null, $lobs = array())
$name = $parameter;
} else {
$regexp = '/^.{'.($position+1).'}('.$this->options['bindname_format'].').*$/s';
$parameter = preg_replace($regexp, '\\1', $query);
if ($parameter === '') {
$param = preg_replace($regexp, '\\1', $query);
if ($param === '') {
$err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null,
'named parameter name must match "bindname_format" option', __FUNCTION__);
return $err;
}
$length = strlen($parameter) + 1;
$length = strlen($param) + 1;
$name = $param;
}
$name = $parameter;
if ($pgtypes !== false) {
if (is_array($types) && array_key_exists($name, $types)) {
$pgtypes[] = $this->datatype->mapPrepareDatatype($types[$name]);
Expand Down

0 comments on commit e68e866

Please sign in to comment.