You are not logged in.
I'm a newbie at this, so please bear with me. I'm trying to learn PHP-MySQL. I have this script that I'm trying to run :
<?php
echo "Hell1o";
$host = "localhost";
$user = "root";
$pass = "a";
$r = mysql_connect($host, $user, $pass);
if (!$r) {
echo "Could not connect to server\n";
trigger_error(mysql_error(), E_USER_ERROR);
} else {
echo "Connection established\n";
}
echo mysql_get_server_info() . "\n";
mysql_close();
?>
When I go to localhost/~home and click on the .php file that contains this script, nothing other than "Hello" is printed on browser screen. I have setup php and mysql to work. I have setup phpmyadmin and even it seems to work fine. Why aren't the other echo statements working?
Offline
I'm sorry I just found out my error. Apparently mysql_connect is deprecated as of new versions of php. The correct syntax is mysqli_connect. The same goes for all other mysql commands.
Offline