Dwi Hyuga

Dwi Hyuga

  • NA
  • 116
  • 21.7k

can i add PDO connection on mysql connection (dual)

Jan 15 2016 10:00 PM
I have question about PHP connection.
If you usually using MySQL connection, it'll easy to use. but my question is like this, what happen if i mix PDO connection with usual connection.
 
it was like :
 
<?php 
mysql_connect('localhost','user','password'); 
mysql_select_db('database');
?>
<?php
$host = "localhost";
$user = "user";
$password = "password";
$database_name = "database";
$pdo = new PDO("mysql:host=$host;dbname=$database_name", $user, $password);
?>
 
in one file named connect.php
will it crash each other??
 
thank for your answer.. 

 

Answers (2)