I've installed a LAMP server in a Oracle VM VirtualBox using Ubuntu 14.0 desktop recently so I could learn about PHP interactions with MySQL databases.
I cannot establish a connection with my database. It doesn't give any error messages even if I use a wrong username. I know I've set up LAMP correctly because I've run other PHP files on localhost.
This is my script:
<?php
function conexao() {
$db = 'webservice';
$user = 'xxxxx';
$pass = 'xxxxx';
$host = 'localhost';
$conn = mysql_connect($host,$user,$pass);
mysql_select_db($db);
}
conexao();
?>
I'm supposed to get a message when my connection info are wrong, right? Well, nothing happens, just like when every info is okay.