Amp\Mysql\Stmt::bind PHP Method

bind() public method

public bind ( $paramId, $data )
    public function bind($paramId, $data)
    {
        if (is_numeric($paramId)) {
            if ($paramId >= $this->numParamCount) {
                throw new \Exception("Parameter id {$paramId} is not defined for this prepared statement");
            }
            $i = $paramId;
        } else {
            if (!isset($this->byNamed[$paramId])) {
                throw new \Exception("Parameter :{$paramId} is not defined for this prepared statement");
            }
            $array = $this->byNamed[$paramId];
            $i = reset($array);
        }
        do {
            $realId = -1;
            while (isset($this->named[++$realId]) || $i-- > 0) {
                if (!is_numeric($paramId) && $this->named[$realId] == $paramId) {
                    break;
                }
            }
            $this->conn()->bindParam($this->stmtId, $realId, $data);
        } while (isset($array) && ($i = next($array)));
        if (isset($this->prebound[$paramId])) {
            $this->prebound[$paramId] .= $data;
        } else {
            $this->prebound[$paramId] = $data;
        }
    }