查看与您的MySQL服务器版本相对应的手册,以便在第1行的“07:28:29”附近使用正确的语法

I wanna insert record to MySQL but it returns error :

check the manual that corresponds to your MySQL server version for the right syntax to use near '07:28:29)' at line 1

I use PHP for connecting to database. here is what i write :

$id = 353567452;
$firstname = "My_name";
$username = "@myusername";
$message_date = "2017-01-01 17:29:20";
$sql_check = "SELECT id, firstname, username, register_date FROM RJ_userino WHERE id=" . "$chat_id AND firstname=$firstname AND username=$username AND register_date=$message_date";
            $sql_insert = "INSERT INTO RJ_userinfo (id, firstname, username, register_date) VALUES (" . "$chat_id, $firstname, $username, $message_date)";
            $check = $db_req->query($sql_check);
            if ($check->num_rows == 0){
                $db_req->query($sql_insert);
            }

And here is my column info : enter image description here

where is the problem ?

$message_date should be a timestamp which is number eg. 1487230853

u can use the php function strtotime();

$message_date = strtotime("2017-01-01 17:29:20");