strict_types = 1 );
error_reporting ( E_ALL );
$db_host = 'localhost';
$db_name = 'rem_teh_servis';
$db_user = 'rem_teh_site';
$db_password = 'thrtu4hr5u4u';
$pdo = new PDO( sprintf ( 'mysql:host=%s;dbname=%s;charset=utf8', $db_host, $db_name ), $db_user, $db_password, [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,
] );
$string = 'userName#userSurname#userTelefon#userEmail#userPasword_1#userPasword_2';
$array = array_combine ( [ 'name', 'surname', 'telefon', 'mail', 'pass1', 'pass2' ], explode ( '#', $string ) );
$stmt = $pdo -> prepare( 'INSERT INTO authorized_user SET name = ?, surname = ?, mail = ?, telefon = ?, pass = ?' );
$stmt -> execute( [ $array['name'], $array['surname'], $array['mail'], $array['telefon'], $array['pass1'] ] );