#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    8
    Rep Power
    0

    MySQL and Apache


    Hello, I am very new to MySQL so forgive me. Currently I am attempting to successfully upload this script to Apache:

    Code:
    <?php
    mysql_connect("localhost", "root", "mypass") or die(mysql_error());
    echo "Connected to MySQL<br />";
    ?>
    So that when I view the .php page it displays "Connected to MySQL." Instead what it displays is nothing at all. I am running linux and I have all my .php files in /srv/http. I can see them in localhost but when I click on the appropriate file with the above code it doesn't work. Is there a problem with my syntax or am I doing something else wrong? I am following this tutorial:

    http://www.tizag.com/mysqlTutorial/mysqlconnection.php

    But it doesn't seem to have a very good explanation of how to upload the .php to my webserver.

    Thanks
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,316
    Rep Power
    7170
    This sounds like a PHP problem rather than a MySQL problem. When you are viewing the file, what is the URL in your browser's address bar?
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    8
    Rep Power
    0
    Originally Posted by E-Oreo
    This sounds like a PHP problem rather than a MySQL problem. When you are viewing the file, what is the URL in your browser's address bar?
    This problem has been solved. Forgot to uncomment something. Thanks.

IMN logo majestic logo threadwatch logo seochat tools logo