Please help me connect PHP to MySql - Newbie problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alan Silver

    Please help me connect PHP to MySql - Newbie problem

    Hello,

    I'm a newbie at PHP and MySql, although I have wads of experience of
    ASP, ASP.NET, SQL Server, etc.

    I have just installed PHP 5.2.3 on a server (Windows Server 2003), as
    well as MySql 5.0.45. Both of these work fine independently, but I can't
    get PHP to connect to MySql.

    The first (and probably most basic) problem is that when I run phpinfo()
    I don't see any mention of MySql. I suspect that this is the cause of
    the lack of connectivity.

    I have removed the comments from the following two lines in php.ini
    (which is in C:\Windows)...

    extension=php_m ysql.dll
    extension=php_m ysqli.dll

    I've also got the following line in there...

    extension_dir = "C:\Program Files\PHP\ext\"

    which points to the folder containing the two DLLs mentioned above.

    I've rebooted the machine a couple of times since making these changes.

    As I said, when I run phpinfo(), it doesn't mention MySql at all.

    Anyone any ideas? If I try to connect, nothing happens. No errors,
    nothing. I tried the following sample script from
    http://uk.php.net/manual/en/function.mysql-connect.php to test it...

    <?php
    $link = mysql_connect(' localhost', 'mysql_user', 'mysql_password ');
    if (!$link) {
    die('Could not connect: ' . mysql_error());
    }
    echo 'Connected successfully';
    mysql_close($li nk);
    ?>

    (where I changed the user name and password obviously), but this didn't
    produce anything. No message, no error, just a blank page.

    TIA for any help

    --
    Alan Silver
    (anything added below this line is nothing to do with me)
Working...