HI,
main point in this session:
1. insert data
2. create data
3. select data
4. update data
5. delete data
main point in this session:
1. insert data
2. create data
3. select data
4. update data
5. delete data
1. insert data
<?php
$servername = "localhost";
$username = "abcd";
$password = "blank";
$dbname = "sample";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql = "INSERT INTO hello(firstname, lastname, email)
VALUES ('mayur', 'kumar', 'kumar@kumar.com')";
if (mysqli_query($conn, $sql)) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
mysqli_close($conn);
?>
in the above example shows that mysqli connection pass & insert data into hello table of sample database.
if record inserted then show message about record inserted sucessfully.
remaining point we discuss in next session
<?php
$servername = "localhost";
$username = "abcd";
$password = "blank";
$dbname = "sample";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql = "INSERT INTO hello(firstname, lastname, email)
VALUES ('mayur', 'kumar', 'kumar@kumar.com')";
if (mysqli_query($conn, $sql)) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
mysqli_close($conn);
?>
in the above example shows that mysqli connection pass & insert data into hello table of sample database.
if record inserted then show message about record inserted sucessfully.
remaining point we discuss in next session
THANK YOU FOR THE INFORMATION
ReplyDeletePLEASE VISIT US
Seo Services in Bangalore