Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004
    Posts
    1

    Unanswered: cgi script runs on mysql 4 but not 3 ???

    I have a web page that i made that uses a mysql(4.0) server which is at another location. Everything was working fine, but I have to use a database on one of the servers here at work. (3.23).

    The database name, password, and username are the exactly the same as they were on the other server, (so, theoretically i should be able to just change the hostname in the script and all should be well).... its not...

    here is the relevent piece of code from the script.
    Code:
    ### GET THE MASTERRECORD FROM THE INPUT DATA
    $www{'licnum'} = 0 if !$www{'licnum'};
    $sql = qq{
    select FIRSTNAM,LASTNAME,(CURDATE()+1-1) as Today, MASTREC
    from CLIENT where LICENSEN = "$www{'licnum'}" and BIRTH = "$dob"; };
    print "<!--\n##############\n$sql\n############## -->";
    
    $sth=$dbh->query($sql);
    print "<!-- after query -->";
    %data=$sth->fetchhash();
    print "<!-- after fetch -->";
    
    if (!%data) {...
    keep in mind that the ONLY thing i changed in the script was the hostname..
    The page works fine when connecting to the 4.0 server.
    When connecting to the 3.23 server it dosn't display the whole web page.
    I added the comments above to see where the problem occurs. when looking at the html source for the output of the script, it gets to "after query" and then stops, which leads me to believe that the fetchhash part failed?


    in lost here.

    note: if i connect to the 3.23 mysql server from a command line and run the sql query it works perfectly.

  2. #2
    Join Date
    Mar 2004
    Posts
    480
    If the query runs fine from the command line then it isn't an issue with mysql. You should post this in the relevant scripting forum to get an answer to your problem.

Posting Permissions

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