Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php mysqli insert name adress

<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "database";
// Create connection
$conn = new mysqli($servername, $username, $password,$dbname);

// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";


$sql = "INSERT INTO students (student_name, student_email, student_city)
VALUES ('John', 'john@example.com','los angeles')";

if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}$conn->close();
?>
 
PREVIOUS NEXT
Tagged: #php #mysqli #insert #adress
ADD COMMENT
Topic
Name
8+7 =