SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to connect to mysql using phpmyadmin?

    I am new to mysql and php and have started out with Kevin Yanks: Build your own database driven website using php & mysql. It's easy to follow the examples in the book, but I'm in trouble when it comes to inserting data into the database (jokes.php on pages 75 ff). When I try the script I get: Unable to connect to the database server at this time.
    I have installed xampp 1.6.7 and I'm using phpmyadmin to control mysql. I have written the config.inc.php file using the web-based setup script. But I can't get it to work correctly. There's obviously something I'm missing, but what? How do I set up phpmyadmin to connect to the database?
    Geir

  2. #2
    SitePoint Evangelist BJ Duncan's Avatar
    Join Date
    Jun 2007
    Location
    Bowen Mountain, NSW
    Posts
    490
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is not the phpmyadmin that connects to the database, it is within the code.

    You need to ensure that the details entered in your config.inc.php file is the same as the details for your database.

    Are you running on a test server? Or are you on a live production server?

    Also ensure that you have the include file within your code:
    PHP Code:
    <?php

    // this will connect to the database
    include('config.inc.php');

    // rest of code here

    ?>
    Paste your code and your error message and we could assist further.
    Regards,
    BJ Duncan

  3. #3
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I got it. It had cluttered with username og password in the php code. After fixing it, I can connect to the databases as expected.
    But thanks anyway.
    Geir


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •