<?php
$db_host = 'localhost';
$db_username = 'forum';
$db_name = 'forum';
$db_pass = '*root';
$CName = $_POST['CName'];
$Username = $_POST['Username'];
$Time = $_POST['Time'];
$connect = mysqli_connect($db_host, $db_username, $db_pass) or die("Couldn't connect to the database1");
mysqli_select_db($connect, $db_name) or die("Couldn't connect to the database2");
$query = 'INSERT INTO `u707651_forum`.`configs` (`CName`, `Username`, `Time`) VALUES ("'.$CName.'", "'.$Username.'", "'.$Time.'")';
mysqli_query($connect, $query);
?>
Save.php?Cname="Rage"&Username = "Sapdragon";Time = "10.02.2002"
Save.php?Cname=Rage&Username = Sapdragon;Time = 10.02.2002
$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
$opt = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,
];
$pdo = new PDO($dsn, $user, $pass, $opt);
$query = 'INSERT INTO `configs` (`CName`, `Username`, `Time`) VALUES (?,?,?)';
$stmt->$pdo->prepare($query);
$stmt->execute([$CName,$Username, $Time]);
$id = $pdo->lastInsertId();