<?php

// array containing data
$array = array(
"name" => "John",
"surname" => "Doe",
"email" => "vog.ecnegilletni|eod.j#vog.ecnegilletni|eod.j"
);

// build query…
$sql = "INSERT INTO table";

// implode keys of $array…
$sql .= " (`".implode("`, `", array_keys($array))."`)";

// implode values of $array…
$sql .= " VALUES ('".implode("', '", $array)."') ";

// execute query…
$result = mysql_query($sql) or die(mysql_error());

?>