DB::connect and PHP : hostname seems to be ignored ?!?!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Claus van de Vlierd

    DB::connect and PHP : hostname seems to be ignored ?!?!


    Hello ,

    a) in the following script (under RedHat AS3 with PHP 4.3.2 ) I make
    a "DB::connec t" to an existing "mysql" database named
    "docu_files_of_ cvdv" .

    The strange thing is : it works -- even if I give as protocol the
    string
    "nonsenseprotoc ol" (instead of "unix" or "tcp") and as Hostname
    "nonsensehostna me" ... !!

    Obviously PHP ignores the "protocol" and takes as Hostname the default
    "localhost" .. ?!? I do NOT understand .. ! :


    ### here is the script :

    #!/usr/bin/php
    <?php
    require("DB.php ");
    print("*** here PHPMYSQL.php *** \n");
    print("*** now TRYING to connect .. *** \n");
    $res =
    DB::connect("my sql://nonsenseprotoco l+nonsensehostn ame/docu_files_of_c vdv");
    print("*** now having tried to connect .. *** \n");
    if (DB::isError($r es))
    {
    $str = $res->getMessage() ;
    print("$str \n");
    exit;
    }
    else
    {
    print("*** o.k. - result : $res *** \n");
    print("*** now having done DB::connect -- successfully .. ?!?? *** \n");
    }
    exit;
    ?>

    ############### #

    here is the result - having executed it :


    Content-type: text/html
    X-Powered-By: PHP/4.3.2
    *** here PHPMYSQL.php ***
    *** now TRYING to connect .. ***
    *** now having tried to connect .. ***
    *** o.k. - result : Object ***
    *** now having done DB::connect -- successfully .. ?!?? ***


    ############### ############### #############






    b) HOW can I induce the PHP-Interpreter to EVALUATE the "protocol" and
    "hostname" - Parameters in the "DB::connec t"-string ?!

    c) thanx for any hint :

    Claus van de Vlierd

  • Scott Auge

    #2
    Re: DB::connect and PHP : hostname seems to be ignored ?!?!

    In article <3ifhavFlc7edU1 @news.dfncis.de >,
    Claus van de Vlierd <claus.van.de.v lierd@uni-oldenburg.de> wrote:
    [color=blue]
    > Hello ,
    >
    > a) in the following script (under RedHat AS3 with PHP 4.3.2 ) I make
    > a "DB::connec t" to an existing "mysql" database named
    > "docu_files_of_ cvdv" .
    >
    > The strange thing is : it works -- even if I give as protocol the
    > string
    > "nonsenseprotoc ol" (instead of "unix" or "tcp") and as Hostname
    > "nonsensehostna me" ... !!
    >
    > Obviously PHP ignores the "protocol" and takes as Hostname the default
    > "localhost" .. ?!? I do NOT understand .. ! :
    >
    >
    > ### here is the script :
    >
    > #!/usr/bin/php
    > <?php
    > require("DB.php ");
    > print("*** here PHPMYSQL.php *** \n");
    > print("*** now TRYING to connect .. *** \n");
    > $res =
    > DB::connect("my sql://nonsenseprotoco l+nonsensehostn ame/docu_files_of_c vdv");
    > print("*** now having tried to connect .. *** \n");
    > if (DB::isError($r es))
    > {
    > $str = $res->getMessage() ;
    > print("$str \n");
    > exit;
    > }
    > else
    > {
    > print("*** o.k. - result : $res *** \n");
    > print("*** now having done DB::connect -- successfully .. ?!?? *** \n");
    > }
    > exit;
    > ?>
    >
    > ############### #
    >
    > here is the result - having executed it :
    >
    >
    > Content-type: text/html
    > X-Powered-By: PHP/4.3.2
    > *** here PHPMYSQL.php ***
    > *** now TRYING to connect .. ***
    > *** now having tried to connect .. ***
    > *** o.k. - result : Object ***
    > *** now having done DB::connect -- successfully .. ?!?? ***
    >
    >
    > ############### ############### #############
    >
    >
    >
    >
    >
    >
    > b) HOW can I induce the PHP-Interpreter to EVALUATE the "protocol" and
    > "hostname" - Parameters in the "DB::connec t"-string ?!
    >
    > c) thanx for any hint :
    >
    > Claus van de Vlierd[/color]


    I think you want to look in DB.php to see what is going on. The PHP
    Interpreter has nothing to do with this issue.

    Comment

    Working...