PDO(PHP Data Object) vs MySQL
We all know PHP is open source.it means no need to pay for downloading or executing php in our platform.
1.Why PHP?
PHP (Hypertext preprocessor) is a recursively acronym of PHP .
In starting days PHP stand for Personal Home Page but after that according to its need and use it becomes very popular with name Hypertext preprocessor
P-Pre
H-Hypertext
P-Processor
currently 7.1 is the latest version of PHP.
Now comes on My SQL
My SQL is also open source database .
So generally PHP is combined with MySQL because both are open source.
MySQL is also categorized into two parts-
1.MySQL
2.MySQL i
MySQL is fully procedural it means all codes programming thins related to manually coding.
In MySQL The application fully depends upon Programmer/developer so that in MySQL The hole responsibility associated with programmer.
Note:- Now these days it's very unpopular database so that's it's not recommended to use MySQL.
MySQL i-here i stands for improved .
Now these days MySQL i is very recommendable because MySQL i follow both concepts -
1.Procedural
2.Object - Oriented concepts
In Object -oriented concepts the dependency of user on program is reduced because all things tables /class /object are connected with each other as loosely coupled means according to need they just associated with each other and after full-feel the need they worked individually .
so in this way all tasks become very easier.
In Object -oriented concepts the dependency of user on program is reduced because all things tables /class /object are connected with each other as loosely coupled means according to need they just associated with each other and after full-feel the need they worked individually .
so in this way all tasks become very easier.
|
<?php
$servername ="localhost";//host name like website name or 127.0.0.1
$username = "username";//database username like root
$password = "password";//password like 1234
// Create connection
$con = new mysqli($servername, $username, $password);
// Check connection
if ($con->connect_error) {
die("Connection failed: " . $con->connect_error);
}
echo "Connected successfully";
// destroy connection
$con->close();
?>
|
Comments
Post a Comment