How to bind params in PDO when using OOP : I am using OOP for my project and PDO. I have a class, in that class, I have a method
like this: 

  

      public function insert($fields){
        //$fields is the array containing key and values like this
        // $fields['name'=>'name_field','city'=>'city_field'];

    	//INSERT INTO table_name (name,city) VALUES (':name',':city')
    
    	$sql = "";
    	$sql .= "INSERT INTO table_name (".implode(',', array_keys($fields)).") VALUES ";
    	$sql .=  "(':".implode("',':", array_keys($fields)).")";
    
    	
    	$stmt = $this->connect()->prepare($sql);
    
    
    		//so here how can I bind parameters??
    
    
    	$stmtExec = $stmt->execute();
    
    
    }

 