public function insert($tableName, array $data)
    {
        $query = sprintf("INSERT INTO $tableName (%s) VALUES (%s)",
            implode(', ', array_keys($data)), 
            implode(', ', array_fill(0, count($data), '?'))
        );

        $stmt = $this->prepare($query);
        $stmt->execute(array_values($data));
        return $stmt;
    }
public function insert($tableName, array $data)
    {
        $query = sprintf("INSERT INTO $tableName (%s) VALUES (%s)",
            implode(', ', array_keys($data)), 
            implode(', ', array_fill(0, count($data), '?'))
        );

        $stmt = $this->prepare($query);
        $stmt->execute(array_values($data));
        return $stmt;
    }
public function insert ( $ tableName , array $ data ) { $ query = sprintf ( "INSERT INTO $tableName (%s) VALUES (%s)" , implode ( ', ' , array_keys ( $ data ) ) , implode ( ', ' , array_fill ( 0 , count ( $ data ) , '?' ) ) ) ; $ stmt = $ this -> prepare ( $ query ) ; $ stmt -> execute ( array_values ( $ data ) ) ; return $ stmt ; }
Inserts some data into the specified table

@param string $tableName
@param array $data
@return Statement
Inserts some data into the specified table