Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHPDev: How do I access MySQL?

    I have phpdev working fine for php, but I am trying to set up a database now, and it seems like I remember setting up a password back when I installed it, but I have no idea what that was now.

    How do I find out what it was, and what the other information is?

    (login?)

  • #2
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    You don't need a password or user, leave those blank. Launch phpdev and click on start_here.htm > localhost/phpmyadmin to create your new database. To connect to the database I use this php code, the only change it needs is the DB_NAME, canada would be changed to your database name.

    PHP Code:
    <?php
    define 
    ('DB_USER''');
    define ('DB_PASSWORD''');
    define ('DB_HOST''localhost');
    define ('DB_NAME''canada');

    $dbc mysql_connect (DB_HOSTDB_USERDB_PASSWORD);
    mysql_select_db (DB_NAME);
    ?>
    When you upload your code to a server you will have to enter the DB_USER and DB_PASSWORD, which you will get when you setup the database, so make sure you write those down. phpdev has PHP Version 4.2.3, you might run into some problems with newer code.
    Last edited by Len Whistler; 01-06-2007 at 08:35 PM.
    Leonard Whistler


  •  

    Posting Permissions

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