title: mysql_connect() causing 500 error
body: <p>I am a bit new to web development. So there might be a trivial thing that I might have missed and am not able to figure out by searching online for some time. Here is the problem</p>
  
  <p>In my PHP script I am connecting to the data as shown below</p>
  
  <pre><code>$con = mysql_connect('localhost','root','');
  if (!$con)
  {
      die('Could not connect: ' . mysql_error());
  }
  </code></pre>
  
  <p>This function works fine when I run it from shell prompt on the server using "php -f" command
  But when I try to execute this script using a browser session, it gives an error.</p>
  
  <p>"HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request"</p>
  
  <p>The server php version is 5.3.3 and it is on Cent OS.</p>