You are here: DB::connect and PHP : hostname seems to be ignored ?!?! « PHP Programming Language « IT news, forums, messages
DB::connect and PHP : hostname seems to be ignored ?!?!

Posted by Claus van de Vlierd on 06/29/05 15:08

Hello ,

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

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

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("mysql://nonsenseprotocol+nonsensehostname/docu_files_of_cvdv");
print("*** now having tried to connect .. *** \n");
if (DB::isError($res))
{
$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::connect"-string ?!

c) thanx for any hint :

Claus van de Vlierd

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация