<?php

class Test{

	public function insert($conn, $table, $array){
					
			
			
					$columns = implode(", ",array_keys($array));
					$escaped_values = array_map(mysql_real_escape_string, array_values($array));
					$values  = implode("',' ", $escaped_values);
					
					echo $sql="INSERT INTO test ($columns) VALUES ('$values')";

					$run=mysql_query($sql,$conn);
					

			}	
			
					
	
	
}

?>