“Php mysql memasukkan data” Kode Jawaban

Php mysql memasukkan 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 = "INSERT INTO MyGuests (firstname, lastname, email)
VALUES ('John', 'Doe', '[email protected]')";

if ($conn->query($sql) === TRUE) {
  echo "New record created successfully";
} else {
  echo "Error: " . $sql . "<br>" . $conn->error;
}

$conn->close();
?>
Jolly Jellyfish

masukkan ke php myqsl

$sql = "INSERT INTO database_table('arg1, 'arg2', ...) VALUES ('value1,
value2, ...)'";
Armandres

Jawaban yang mirip dengan “Php mysql memasukkan data”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya