K
K
kiril9012015-12-22 15:17:26
MySQL
kiril901, 2015-12-22 15:17:26

How to fix update request?

I want to make an update request, it gives an error, I need to change the data in the entire table when submitting from the form, thanks

UPDATE `users` SET `first_name`=value-1,`last_name`=value-2,`email`=value-3,`facebook`=value-4,`silka`=value-5,`vkon`=value-6 WHERE TABLE_NAME='users'

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
romy4, 2015-12-22
@romy4

instead of value substitute the desired values

D
Dmitry Kovalsky, 2015-12-22
@dmitryKovalskiy

UPDATE `users` SET `first_name`=`first_name`-1 ,`last_name` = 'last_name' -2, `email`=`email`-3,`facebook`=`facebook`-4,`silka`=`silka`-5,`vkon`=`vkon`-6 WHERE 1=1

Learn SQL. You wrote garbage that has nothing to do with the SQL language, and the answer to your question is written about the fifth chapter of any SQL textbook

A
Alex Safonov, 2015-12-23
@elevenelven

UPDATE `users` SET `first_name`='value-1',`last_name`='value-2',`email`='value-3',`facebook`='value-4',`silka`='value-5',`vkon`='value-6' WHERE TABLE_NAME='users'

You forgot to wrap the strings in single quotes.
`first_name`=value-1 is wrong.
`first_name`='value-1' is correct.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question