What's wrong with the SQL query?

0 like 0 dislike
10 views
Hi all, please tell me, what is wrong with the SQL query
The head does not works already
if (isset($_POST['date_btn'])) { $surname = $_POST['surname']; $name = $_POST['name']; $patronymic = $_POST['patronymic']; $birth_date = $_POST['birth_date']; $e_mail = $_POST['e-mail']; $phone_number = $_POST['phone_number']; $region = $_POST['region']; $city = $_POST['city']; $school = $_POST['school']; $work_position = $_POST['work_position']; mysqli_query($connect, "UPDATE users SET surname = '$surname', name = '$name', patronymic = '$patronymic', birth_date = '$birth_date', e_mail = '$e_mail' phone_number = '$phone_number' region = '$region', city = '$city', school = '$school' work_position = '$work_position' WHERE login = '$login';"); header('Location: https://********.**/?page=date'); }
asked by | 10 views

1 Answer

0 like 0 dislike
commas lacking
e_mail = '$e_mail' phone_number = '$phone_number' region

must be
e_mail = '$e_mail', phone_number = '$phone_number', region


and I advise you to read about sql injection and mysqli prepare

327_v1.png
answered by

Related questions

0 like 0 dislike
1 answer
asked Aug 18 by Samuello
0 like 0 dislike
1 answer
asked Jul 13 by Samuello
0 like 0 dislike
1 answer
asked Jun 4 by khodos_dmitry
0 like 0 dislike
3 answers
asked May 22 by Madeas
0 like 0 dislike
1 answer
asked Apr 12 by LordPrimes
110,581 questions
257,150 answers
0 comments
476 users