Problem linkin mySQL Database


I’m here because my php/sql setup doesn’t work. I have my home page for my site which is “index.php” with a formular on it. This formular is to log into my site. It heads to “connex.php” with a “POST” method.
Here is the code of “connex.php”

$user = $_POST['username'];
$pass = $_POST['password'];

if(isset($user) && isset($pass)){
		$_SESSION['user'] = $user;
		header('Location: ../index.php');
		$erreur = true;
		header('Location: ../index.php');

function connect($user,$pass){
		$bdd = new PDO('mysql:host=;dbname=c9', 'remsdevoiron', '');
		$req = $bdd->prepare('SELECT count(*) FROM users WHERE Login = ? AND Password = ?');
		$req->execute(array($user, $pass));
		return ((int)$req->fetch() > 0);
	catch (Exception $e)
	        die('Erreur : ' . $e->getMessage());

The problem comes from this line :
$bdd = new PDO('mysql:host=;dbname=c9', 'remsdevoiron', '');

When I connect with pseudo/password couples which are in my database, it works, but it works with any pseudo/password couple. I think it’s because the database isn’t linked. I’ve tryed a lot of stuff but anything worked.
No error message is displayed.
And it’s very urgent, the deadline of this project is tomorrow.
I you know where the issue comes from, it would be so nice.