Does not write to database without giving errors?

There is code:

$con = mysqli_connect('localhost','admin','admin','test') or die("ERROR");
$con->set_charset("utf8");
 $query = mysqli_query($con, " INSERT INTO users (avatar) VALUES ('$avatar') WHERE id='$userid'");


If you write to it echo the variable and output the avatar, then a path appears to flooded with pictures of what may be wrong? No errors neither in the logs, no
July 12th 19 at 17:37
3 answers
July 12th 19 at 17:39
The query itself is wrong. INSERT - adding new rows to the table, it can not be WHERE.
July 12th 19 at 17:41
And no error displays because they are disabled I guess.
Add to the beginning of the file:
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
what error Pochepa errors muscula?) - jamir.Treut commented on July 12th 19 at 17:44
July 12th 19 at 17:43

Find more questions by tags PHP