library/database/class.sqldriver.php
public function NamedParameter($Name, $CreateNew = FALSE, $Value = NULL) {
      // Format the parameter name so it is safe for sql
      $NiceName = ':'.preg_replace('/([^\w\d_-])/', '', $Name); // Removes everything from the string except letters, numbers, dashes, and underscores

      if($CreateNew) {
         // Make sure that the new name doesn't already exist.
         $NumberedName = $NiceName;
         $i = 0;
         while (array_key_exists($NumberedName, $this->_NamedParameters)) {
            $NumberedName = $NiceName.$i;
            ++$i;
         }
         $NiceName = $NumberedName;
      }
      
      if(!is_null($Value)) {
         $this->_NamedParameters[$NiceName] = $Value;
      }
         
      return $NiceName;
   }
public function NamedParameter($Name, $CreateNew = FALSE, $Value = NULL) {
      // Format the parameter name so it is safe for sql
      $NiceName = ':'.preg_replace('/([^\w\d_-])/', '', $Name); // Removes everything from the string except letters, numbers, dashes, and underscores

      if($CreateNew) {
         // Make sure that the new name doesn't already exist.
         $NumberedName = $NiceName;
         $i = 0;
         while (array_key_exists($NumberedName, $this->_NamedParameters)) {
            $NumberedName = $NiceName.$i;
            ++$i;
         }
         $NiceName = $NumberedName;
      }
      
      if(!is_null($Value)) {
         $this->_NamedParameters[$NiceName] = $Value;
      }
         
      return $NiceName;
   }
public function NamedParameter ( $ Name , $ CreateNew = FALSE , $ Value = NULL ) { // Format the parameter name so it is safe for sql $ NiceName = ':' . preg_replace ( '/([^\w\d_-])/' , '' , $ Name ) ; // Removes everything from the string except letters, numbers, dashes, and underscores if ( $ CreateNew ) { // Make sure that the new name doesn't already exist. $ NumberedName = $ NiceName ; $ i = 0 ; while ( array_key_exists ( $ NumberedName , $ this -> _NamedParameters ) ) { $ NumberedName = $ NiceName . $ i ; ++ $ i ; } $ NiceName = $ NumberedName ; } if ( ! is_null ( $ Value ) ) { $ this -> _NamedParameters [ $ NiceName ] = $ Value ; } return $ NiceName ; }
Takes a parameter name and makes sure it is cleaned up to be used as a
named parameter in a pdo prepared statement.
@param string $Name The name of the parameter to cleanup
@param boolean $CreateNew Wether or not this is a new or existing parameter.
@return string The cleaned up named parameter name.
Takes a parameter name and makes sure it is cleaned up to be used as a named parameter in a pdo prepared statement .