Can't connect to MySql database using PHP : <p>I created a login screen for my website but I can't seem to reach my MySql database via PHP. I'm using XAMPP 1.7.7., Codelobster PHP Edition and MySql Workbench. I know this is a really old version of XAMPP but I have to use this because at school this version is installed on every PC.
So I wrote the PHP file which establishes the connection with the database (called metaler) and another PHP file which gets the value of the input fields on the login screen via POST method, and all I want to do is insert these values to one of my tables (called user_data). There is no password set for the database.</p>

<p>Here goes the code:</p>

<pre><code>&lt;?php
$connect = mysql_connect("localhost", "root", "")

or exit("Nem sikerült kapcsolódni a szerverhez.");

mysql_select_db("metaler",$connect)

or exit("Nem sikerült megnyitni az adatbázist.");

mysql_query("SET NAMES 'utf8'");
?&gt;
</code></pre>

<p>Above is the connection PHP.</p>

<pre><code>&lt;?php
include("connecttodb.php");

$ema=$_POST['ema'];
$pass=$_POST['pass'];

$insert=("INSERT INTO metaler.user_data (email, password)
VALUES ($ema, $pass)");

$result=mysql_query($insert);

if($result){
print "Sikeres bejelentkezés!";
}
else{
print "Nem sikerült kapcsolódni.";
}

mysql_close($connect);
?&gt;
</code></pre>

<p>And this is the one that should perform the INSERT command, but all it does is display the error message "Nem sikerült kapcsolódni." which is in the ELSE clause so the mistake must be in the second one.
Since there is no other error message given I couldn't find the answer yet. If you would take a look at my code you'll see I'm a total beginner and maybe the answer is obvious but I need some help.
If you have any suggestions everything is more than welcome.
Thank you in advance!   </p>
