SitePoint Sponsor

User Tag List

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

    connecting to an access database (was "Probably a dumb question...")

    Hey all,

    new to php ,mysql and databases but this is what I have so far:

    $dbcnx = @mysql_connect("localhost", "root", "");
    if(!dbcnx){
    echo("<p>Unable to connect to the " .
    "database server at this time.</p>"
    );
    exit();
    }
    if(! @mysql_select_db("members")){
    echo( "<p>Unable to locate the member " .
    "database at this time.</p>");
    exit();
    }


    Now.. if the table I'm calling to is created in an access database do I have to put anything extra? It seems it won't find the database no matter what.

  2. #2
    Maniacally depressed robot poncho's Avatar
    Join Date
    Dec 2004
    Location
    Belfast, N.Ireland
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The code you have here connects to a MySQL database, NOT an Access database. If you are using a Windows-based server, I suggest you have a look at this article. If not, I would look into ADOdb.

    Of course, it would be a lot easier for you if you used MySQL...

    Cheers;
    Poncho
    Perfecting the art of breaking stuff.
    Check 'em: CakePHP | TextMate


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
  •