I am making an application to save images, when the user does not choose any image is saved in the database a default image that is selected in another table of the database, however at the time of saving the image in the database, php returns the following error:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ',' ???? ' at line 1
Here is the code that looks for the image in the database and displays it:
Search:
$query = "select imagem from imagem_padrao";
$imagem_padrao = mysqli_query($con,$query);
$imagem_padrao = mysqli_fetch_row($imagem_padrao);
$imagem_pronta = $imagem_padrao[0];
Insert:
$query = ("insert into tamanho (foto_aparelho) values ('".$imagem_pronta."')");
mysqli_query($con,$query) or die (mysqli_error($con);
I think the error is happening at the time of inserting the image in array format in the database, but I do not know how to solve it.