HTTP500 error when connecting mysql and php with apache

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • srinivasMP51
    New Member
    • Mar 2008
    • 3

    HTTP500 error when connecting mysql and php with apache

    [php]<?php
    $host = “localhost”; //Host where this database is running.
    $user_name = “root”; //Your MySQL Server’s user name
    $password = “yyyyyyy”; //Your MySQL Server’s Password
    $db_name = “xxxxx”; //Your MySQL Server’s Database.

    //Now connect
    mysql_connect($ host, $user_name, $password) or die(mysql_error ());

    //Now you are connected to MySQL, so choose the databse you want to use
    mysql_select_db ($db_name) or die(mysql_error ());
    echo “Database: $db_name selected successfully”;
    ?>[/php]it is not working
    page showing HTTP500 internal server error
    plz help some one
    Last edited by ronverdonk; Mar 20 '08, 01:33 PM. Reason: code tags inserted
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Please enclose your posted code in [code] tags (See How to Ask a Question).

    This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

    Please use [code] tags in future.

    MODERATOR

    Comment

    Working...