SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: need sql help

  1. #1
    SitePoint Member ronnie173's Avatar
    Join Date
    May 2004
    Location
    texas
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    need sql help

    I purchased a script and I can't connect to the database and when i debug the script it tells me that it cannot locate the DBI. here is the script can anyone tell me if it is configured right.

    use DBI;
    $dbh = DBI->connect("dbi:mysql:$mysqldatabasename","$mysqlusername","$mysqlpassword") || die("Couldn't connect to database!\n");
    &lookup;
    &save;

    $dbh->disconnect;

  2. #2
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    This is a perl connection string, based on the sample given at my host's general info section.

    The only difference is where you have
    "dbi:mysql:$mysqldatabasename"

    my sample code says
    "dbi:mysql:$mysqldatabasename:localhost"

    I know nothing about Perl however, and it could just be specific to my site. Also mine doesn't have the or die bit.

    I assume you are substitutiing your databasename, username and password, and not leaving it as the variable equivalents.


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
  •