“Hapus MySQL PHP” Kode Jawaban

Php mysql menghapus data

<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}

// sql to delete a record
$sql = "DELETE FROM MyGuests WHERE id=3";

if ($conn->query($sql) === TRUE) {
  echo "Record deleted successfully";
} else {
  echo "Error deleting record: " . $conn->error;
}

$conn->close();
?>
naly moslih

Hapus MySQL PHP

$query = $conn -> query("DELETE FROM table_name WHERE some_column = some_value");
if ($query){
	echo "success";
}
Undefined

Jawaban yang mirip dengan “Hapus MySQL PHP”

Pertanyaan yang mirip dengan “Hapus MySQL PHP”

Lebih banyak jawaban terkait untuk “Hapus MySQL PHP” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya