Error when uploading multiple files to the server, how to fix?

There is a form, in it 2 fields, name and address, and click the button to upload files(images) to the server. The idea is that the image in your upload, and link to the picture in the field url_img.
The picture of the table. and
The script is the foreach in which I found, but it work to me the principle is clear, but to make this script running until it comes out.

Here is my code:

<form enctype="multipart/form-data" action method="post">

 <input type="text" name="title" value>

 <input type="text" name="address">

 <label>Upload a background photo</label>
 <input type="file" name="pictures[]">

 <input type="submit" name="upload" value="Save">

if($_POST['upload']) {
 $url_img = $_POST['url_img'];
 $title = $_POST['title'];
 $address = $_POST['address'];

 if($title || $address !== "") {
 $add = mysql_query("INSERT INTO stores VALUES (", '$title', '$address')") or die(mysql_error());
 header("Location: /admin/admin.php?page=all_stores");

 foreach ($_FILES["pictures"]["error"] as $key => $error) {
 if ($error == UPLOAD_ERR_OK) {
 $tmp_name = $_FILES["pictures"]["tmp_name"][$key];
 $name = $_FILES["pictures"]["name"][$key];
 move_uploaded_file($tmp_name, "../upload".$kod.$name);


 $queryup = "UPDATE stores SET $url_img = '{$imgmedia}'";
 $result = mysql_query($queryup);

The code for uploading files is in the foreach. Now I have an error,
Column count doesn't match value count at row 1.
Tell me what in this script is wrong? How it could change the structure of the code, or with fields that something is wrong?
Why is there this variable {$imgmedia} in curly brackets?
July 2nd 19 at 17:05
2 answers
July 2nd 19 at 17:07
Well, the number of fields in 4 stores, and You write 2 without specifying the specific fields. Naturally, there is an error.
Our database has a column url_img but I don't need to enter it manually. When filled with the picture then the link needs to get into this field. I pointed out this field here. $queryup = "UPDATE stores SET $url_img = '{$imgmedia}'"; $result = mysql_query($queryup); but why it is not working. - toby commented on July 2nd 19 at 17:10
: This error is issued on UPDATE and on INSERT. And it is necessary to understand first, and then look no further. - Yazmin64 commented on July 2nd 19 at 17:13
July 2nd 19 at 17:09
In INSERT does not match number of fields in the table and in the query. You should write:
INSERT INTO `stores` (`title`, `address`) VALUES ('$title', '$address');

Find more questions by tags MySQLPHP