mysql_connect fails to connect, fails to display error - just dies

0 AVERY HORTON · April 24, 2015
I watched your video series "How to Install Apache, MySQL, and PHP". And the installs were successful. However when I try to use PHP to connect to the MySQL database, it fails without an error message:

require '../scripts/app_config.php';
echo "connect.php 020!";
mysql_connect(DATABASE_HOST, DATABASE_USERNAME, DATABASE_PASSWORD)
or die("Error connecting to database: " . mysql_error() . "");

echo "connect.php 030!";

The first echo displays but nothing else displays. It just "dies" there. Is there a step or 2 that I am missing? Thanks.

P.S.  DATABASE_HOST, DATABASE_USERNAME, DATABASE_PASSWORD are all valid. 

Post a Reply

Replies

Oldest  Newest  Rating
  • 1

SQL & Databases

107,225 followers
About

Everything SQL and Databases related in here!

Links
Moderators
Bucky Roberts Administrator