#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    1
    Rep Power
    0
    from html form,I fill in details and wish to compare certain data in mysql.

    my dbi code is run normally from the command line.but run under httpd,it fails.

    its seem like the httpd process usually runs under the user id of nobody,which implies there is no configured environment.I was wondering that is the problem of making my perl script is not running properly.

    here is my code:
    $temp=$ENV{'CONTENT_LENGTH'};
    @pairs=split(/&/,$temp);
    ..
    ..
    .. #skip the foraech statement

    use DBI;
    $dbh=DBI->connect('DBI:mysql:$databasename:localhost','','');
    $cursor=$dbh->prepare("select * from $tablename");
    $cursor->execute;
    while(..) #skip the fecthrow statement
    {
    }
    $cursor->finish;
    $dbh->disconnect;

    hope someone can help me.
    thank.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 1999
    Posts
    33
    Rep Power
    15
    Does your DB not have a username/password? What does the apache error_log say if anything?

IMN logo majestic logo threadwatch logo seochat tools logo