Skip to content

Instantly share code, notes, and snippets.

@oneberto
Created January 29, 2018 15:57
Show Gist options
  • Save oneberto/291969c2e748f3dffdeb86100f0f3d36 to your computer and use it in GitHub Desktop.
Save oneberto/291969c2e748f3dffdeb86100f0f3d36 to your computer and use it in GitHub Desktop.
<?php
$servidor = 'localhost';
$usuario = 'root';
$senha = '';
$banco = 'mydb';
$mysqli = new mysqli($servidor, $usuario, $senha, $banco);
// Deletando dados
$sql = "DELETE FROM dados WHERE id=2";
$query = $mysqli->query($sql);
echo 'Registros afetados: ' . $query->affected_rows;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment