I am just wondering what I have done wrong. I successfully installed Netbeans, PHP, MySQL, APACHE on Ubuntu 11.04 and I have been developing applications with them. Recently, Whenever I try to establish a connection with a MySQL using the following lines of code, and run the page from Netbeans, i get a blank page...ie not even the "die" statement is executing on the browser and the entire page becomes blank. Whenever, I comment out these lines, the page runs normally.. I just wondering what crime I have committed..
$conn = mysql_connect("localhost", "user", "password")
or die ("Unable to connect to the server due to an error: " . mysql_error());
if($conn){
echo "Connection established with mysql server";
$db = mysql_select_db($database_name)
or die ("There were some problems while choosing database: ". mysql_error());
}
Please I need help because I have been stuck for the past two days just because of this.