How to connect php to mysql use PDO
TagsHow to connect pdo in mysql, connec php to mysql with pdo, using pdo connect with database in php, connect database php mysqli, php connect mysql example, how to connect php to sql use pdo.
If you want to connect php with mysql then please connect mysql this like.
<?phpCalse connect SQLite or DBMS then you can this like .
$server = "mysql:host=localhost;dbname=test";
$userName ="root";
$password="";
$conn = new PDO($server,$userName,$password);
if($conn){
echo " connect success";
}else{
echo " connect don't success";
}
?>
$conn = new PDO("sqlite:your/database/path/izlearn.db");you coppy url folder database at save ok.
Disconnecting when you no longer need to manipulate the database, you just need to turn $conn to null;
$conn = null;
No comments:
Post a Comment