не записывает в базу данных sql, помогите пожалуйста


<?php

$user_name = filter_var(trim($_POST['name']),

    FILTER_SANITIZE_STRING);
$user_lastname = filter_var(trim($_POST['lastname']),
    FILTER_SANITIZE_STRING);
$user_email = filter_var(trim($_POST['email']),
    FILTER_SANITIZE_STRING);
$user_name = ucfirst($user_name);
$user_lastname = ucfirst($user_lastname);
$user_sex = intval($_POST['sex']);
if ($user_sex < 0 OR $user_sex > 2) $user_sex = 0;
$user_day = intval($_POST['day']);
if ($user_day < 0 OR $user_day > 31) $user_day = 0;
$user_month = intval($_POST['month']);
if ($user_month < 0 OR $user_month > 12) $user_month = 0;
$user_year = intval($_POST['year']);
if ($user_year < 1930 OR $user_year > 2007) $user_year = 0;
$user_country = intval($_POST['country']);
if ($user_country < 0 OR $user_country > 10) $user_country = 0;
$user_city = intval($_POST['city']);
if ($user_city < 0 OR $user_city > 1587) $user_city = 0;
$_POST['password_first'] = trim($_POST['password_first']);
$_POST['password_second'] = trim($_POST['password_second']);
$password_first = trim($_POST['password_first']);
$password_second = trim($_POST['password_second']);
$user_birthday = $user_year . '-' . $user_month . '-' . $user_day;
$errors = array();

$mysql = mysqli_connect('localhost','root','root','app_db');
        $mysql->query("user_last_visit, user_email, user_password, user_name, user_lastname, user_sex, user_day, user_month, user_year, user_country, user_city, user_reg_date, user_lastdate, user_group, user_hid, user_country_city_name, user_search_pref, user_birthday, user_privacy) VALUES ('$server_time',' $user_email ', '$md5_pass ', ' $user_name ', ' $user_lastname ', ' $user_sex ', ' $user_day ', ' $user_month ', ' $user_year ', ' $user_country ', ' $user_city ', ' $server_time ', ' $server_time ', ' $user_group ', ' $hid ', ' $user_country_city_name ', ' $user_search_pref ', '  $user_birthday ')");
        
$mysql->close();

?>

Ответы (0 шт):