I have a syntax problem in my sql code inside the php code, I need to know which video has the largest id in the database to save it to a separate folder with the same id number, so that the path gets saved in the bank. The error that happens is: 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 ' deo) FROM video' at line 1
<?php
include "Conection.php";
include "select.php";
$nome = $_POST['nome_video'];
$genero = $_POST['genero'];
$comando = "SELECT MAX(id_vídeo)FROM video;";
$select = mysqli_query($con,$comando);
if (!$select){
printf("Error: %s\n", mysqli_error($con));
exit();
}
$dado = mysqli_fetch_array($select);
$max_id = $dado['id_vídeo'];
$new_id = $max_id + 1;
$a = "C:/Users/ian/Desktop/UploadTeste/".$new_id;
print $a;
$query = "INSERT INTO video (CPF,nome_vídeo,genero,caminho) VALUES ('$cpf_cookie','$nome','$genero','$a');";
$insert = mysqli_query($con,$query);
mysqli_close($con);
if($insert== true){
echo"<script language='javascript' type='text/javascript'>alert('upload realizado com sucesso!');window.location.href='MinhasProducoes.php'</script>";
}
else{
echo"<script language='javascript' type='text/javascript'>alert('Não foi possível fazer o upload desse vídeo');window.location.href='##EnviarProdução.php'</script>";
}
$destino = 'C:/Users/Ian/Desktop/UploadTeste/' . $_FILES['arquivo']['name'];
$arquivo_tmp = $_FILES['arquivo']['$new_id'];
move_uploaded_file( $arquivo_tmp, $destino );