I have a form and code to upload the info and an image. Everything is working, the image is getting resized and placed in the correct folder. After that I have code to insert the info into the database.
$query = "INSERT INTO `artigos` VALUES ('','$titulo','$nome','$corpo','$categoria','','')";
$result = mysqli_query($con, $query);
//se a query existe entao a pagina é redireccionada
if (mysqli_affected_rows($con) != 0)
{
$sucesso = '<span class="yes">Artigo inserido com sucesso!</span>';
echo $sucesso;
}
I get the message "Artigo inserido com sucesso" but the info doesn't appear in the database. MY $con is the mysqli connect. All the variables exist, I get no error when I press the button, but the info doesn't go to the database. My 'artigos' table contains these fields:
id_artigo, titulo, img, corpo, id_categoria, id_user, date(timestamp).
What is wrong?