Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- u<?php
- $host = 'localhost:3306'; //database host
- $user = 'root'; // DataBase User
- $pass = ''; //database password
- $dbname = 'mydb2'; //database name
- //Connection to Databse
- $conn = mysqli_connect($host, $user, $pass,$dbname);
- // Check connection
- if(!$conn){
- die('Could not connect: '.mysqli_connect_error());
- }
- echo 'Connected successfully<br/>';
- //Update the table
- $id=2;
- $sql = "delete from emp5 where id=$id";
- //Checking for Deleting Table
- if(mysqli_query($conn, $sql)){
- echo "Record deleted successfully";
- }else{
- echo "Could not deleted record: ". mysqli_error($conn);
- }
- // Close connection
- mysqli_close($conn);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement