mvc/catalog-mvc/models/database/dao/DAO.php
# expects array with data to insert
expects array with data to insert
expects array with data to insert
public function insert($array)
    {
        $fields = DatabaseUtils::getFieldsFromColumnArray($this->columns, false, false);
        $pseudoValues = DatabaseUtils::getPseudoValuesFromColumnArray($this->columns, false);
        $sql = "INSERT INTO " .BQ .$this->tableName .BQ ." SET " .$pseudoValues;
        $sql = $this->db->prepare($sql);
        foreach ($array as $key => $value) {
            $columnName = $this->findColumn($key)->getName();
            $sql->bindValue(CL .$columnName, $value);
        }
        $sql->execute();
    }
public function insert ( $ array ) { $ fields = DatabaseUtils :: getFieldsFromColumnArray ( $ this -> columns , false , false ) ; $ pseudoValues = DatabaseUtils :: getPseudoValuesFromColumnArray ( $ this -> columns , false ) ; $ sql = " INSERT INTO  " . BQ . $ this -> tableName . BQ . "  SET  " . $ pseudoValues ; $ sql = $ this -> db -> prepare ( $ sql ) ; foreach ( $ array as $ key => $ value ) { $ columnName = $ this -> findColumn ( $ key ) -> getName ( ) ; $ sql -> bindValue ( CL . $ columnName , $ value ) ; } $ sql -> execute ( ) ; }
expects array with data to insert
expects array with data to insert
# echo $sql ."<br>"; #die(); # echo CL .$columnName . " = " . $value . "<br>";