<?php
	$mysql_host = 'localhost';
	$mysql_user = 'taisir';
	$mysql_password = '';
	$mysql_database = 'tczdb';

	//PDO (PHP Data Objects)
	$pdo_connect = "mysql:host={$mysql_host};dbname={$mysql_database};charset=utf8";

	try {
		$pdo = new PDO($pdo_connect, $mysql_user, $mysql_password);
		$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
		// to cach exception
	} catch (PDOException $texception) {
		echo "PDO Error: " . $texception->getMessage() . "\n" . $pdo_connect;
		exit;
		if($pdo_connect)
		{echo'Successful conection ';}
	}
	/*$con=mysqli_connect("localhost","taisir","123","examdb");
	// Check connection
	if (mysqli_connect_errno())
	  {
	  echo "Failed to connect to MySQL: " . mysqli_connect_error();
	  }
	else {echo "Successful conection" ;}*/
?>
