Establish connecting between php and MySQL #

Before doing anything to the database we need to make the connection between php and MySQL. Once the connection has been made then we can send the SQL query to database.

We are making CRUD operation it means we will need send at least 4 sql query.

  • 1st Query : Create
  • 2nd Query : Read
  • 3rd Query : Update
  • 4th Query : Delete
        $server = "localhost";
        $user = "root";
        $pass = "";

        $con = new mysqli($server, $user, $pass, "crud");

            die("Connection Error");
            echo "Connected Successfully";

comments powered by Disqus