Unknown column in field list error in MySQL Update query

i repeated the request below: (the request is secure)

UPDATE otelozellik 
   SET isim_tr='test', 
       aciklama_tr='<p>test1</p>', 
       uyari_tr='test', 
       tag_tr='test' 
 WHERE id='1'

Database error: unknown column 'aciklama_tr' in 'list of fields'

I reordered the columns after isim_trcontinuing to give an error. When I move isim_trto the last, one after idgives the same error. But moving them to the last position is not for me, because the table will be dynamic, if necessary, add new columns. need an absolute solution.

UPDATE: LAST SCREENSHOT: http://img5.imageshack.us/img5/7215/mysqlerror.jpg

solved. The solution is given below. Thanks to everyone.

+3
source share
4 answers

. .

:

UPDATE `holidaycholic`.`otelbilgi` SET `otelbilgi`.`isim_tr`='test2', `otelbilgi`.`aciklama_tr`='<p>test2</p>', `otelbilgi`.`uyari_tr`='test2', `otelbilgi`.`tag_tr`='test2' WHERE `otelbilgi`.`id`=1

, , .

+1

' , . .

, " ". . , php, , . ALTER TABLE :
ALTER TABLE table_name ADD column_name datatype

0

, ASCII, ?

, phpMyAdmin . , mysql.

Assuming it still works, compare the generated code with the SQL generated by your PHP

0
source

Here is the syntax that works for me all the time:

 "INSERT INTO table(`code`, `description`) VALUES ('".mysql_real_escape_string($code)."', '".mysql_real_escape_string($description)."')";

"table" is a table with an index of AUTO_INCREMENT.

0
source

Source: https://habr.com/ru/post/1784408/


All Articles