UPDATE `users` SET `avatar`= $dd WHERE (`users`.`login` $_COOKIE['login']) When performing writes
Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /home/u565555448/public_html/upload.php on line 17 And on $ _COOKIE ['login'] does not complain, everything works fine if the place $ dd is substituted with some value. I tried to write $ dd in different ways. And in quotes, and divided the request into three parts, the second of which was $ dd
"UPDATE `users` SET `avatar`= ".$dd." WHERE (`users`.`login` $_COOKIE['login'])" Does not work
`login` . $_COOKIE['login']`login` . $_COOKIE['login']...... or equal .......... most likely you would like to write soWHERE users.`login` = "$_COOKIE['login']"... ...... total query"UPDATE `users` SET `avatar`= ".$dd." WHERE `login` ='". $_COOKIE['login']."'""UPDATE `users` SET `avatar`= ".$dd." WHERE `login` ='". $_COOKIE['login']."'"........ or"UPDATE `users` SET `avatar`= $dd WHERE `login` = {$_COOKIE['login']}"- Alexey ShimanskyUnknown column 'Morkoffka' in 'where clause', although in the database the value is hkar.ru/OHnl - MorkoffkaUnknown column 'Morkoffka'means that there is no such column , not a value .. that is, you write likeWHERE $_COOKIE['login'] = ....- Alexey Shimansky