DataTable Editor:Bind Type

DataTable Editor:Bind Type

yellicyellic Posts: 3Questions: 2Answers: 0

protected function _prepare( $sql )
{
$resource = $this->database()->resource();
$this->_stmt = $resource->prepare( $sql );

    // bind values
    for ( $i=0 ; $i<count($this->_bindings) ; $i++ ) {
        $binding = $this->_bindings[$i];

        $this->_stmt->bindValue(
            $binding['name'],
            $binding['value'],
            $binding['type'] ? $binding['type'] : \PDO::PARAM_STR
        );
    }

    $this->database()->debugInfo( $sql, $this->_bindings );
}

in this section from where the $bind['type'] is set? for somehow i am using an MS Access as back-end database and i am facing issues while update a datetime column.MS Acess requires a '#'quote for datetime type, i would like to modify Editor's original Code to achieve this.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,787Questions: 1Answers: 10,114 Site admin
    Answer ✓

    I haven't tested MS Access as a backend at all. Out of interest, did you need to make any other changed to make it work?

    For this, I would suggest using a set formatter if you need the value to have a hash at the front of it.

    There isn't really an API for the PDO type yet - that is there for future expansion.

    Allan

This discussion has been closed.