{ $params = func_get_args(); static $database = null; if ($database == null) { try { $database = new PDO("mysql:host=" . $params[0] . ";dbname=" . $params[1], $params[2], $params[3]); $database->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $except) { echo $except->getMessage(); die; } } return $database; } if (isset($_POST['SubmitAdd'])) { basicInsert($Name, $Surname, $Nickname, $Email, $Password, $AboutYou, $Birthday); } if (isset($_POST['SubmitUpdate'])) { updateUser($Id, $Name, $Surname, $Nickname, $Email, $Password, $AboutYou, $Birthday); } /* function insertIntoDatabase() /* Version Alpha 0.0.1 { $params = func_get_args(); $iterations = ((count($params)-1)/2); $numParams = 1; $prepare = "INSERT INTO " . $params[0] . " ("; for ($iterations; $iterations > 0; $i--) { if ($iterations = 1)
<?php include "./DB_functions.php"; // $pdo = getDatabase("127.0.0.1", "m151", "M151", "M151"); basicInsert();