Created
February 20, 2015 02:30
-
-
Save TiuTalk/b2349ad5a771c133a253 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Inclui o arquivo que faz a conexão ao MySQL | |
include("conexao.php"); | |
// Montamos a consulta SQL para deletar a(s) notícia(s) com ID maior ou igual a três | |
$query = "DELETE FROM `noticias` WHERE (`id` >= 3)"; | |
// Executa a query | |
$deletar = mysql_query($query); | |
if ($deletar) { | |
echo "As notícias foram deletadas com sucesso!"; | |
} else { | |
echo "Não foi possível deletar as notícia, tente novamente."; | |
// Exibe dados sobre o erro: | |
echo "Dados sobre o erro:" . mysql_error(); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment