This is my situation:
I'm trying to connect to my MySQL database with a PHP file on my Apache server, now: my PHP can connect to the MySQL database when I run it from the terminal (using "php -f file.php"
) but when I execute it from a web page it just doesn't connect.
This is my php file:
echo "TRY CONNECTION";
$conn = mysql_connect($servername, $username, $password);
echo "EXECUTED CONNECTION";
The Linux shell prints this:
TRY CONNECTIONEXECUTED CONNECTION
But the web page prints this:
:TRY CONNECTION
I tried using mysqli but the result is the same