473,659 Members | 2,929 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Jul 17 '05 #1
1 2526
In article <3i************ @news.dfncis.de >,
Claus van de Vlierd <cl************ *****@uni-oldenburg.de> wrote:
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

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.
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4157
by: Ralphie | last post by:
Hello everyone, I was wonerding if anybody has a problem that when you try and instantiate DB class it just returns a blank page ... my code is function session() { 1. $this->_oConn =& DB::connect(DSN); 2. if (DB::isError($this->_oConn) ) { 3. catchExc($this->_oConn->getMessage()); 4. }
6
6483
by: Eric W. Holzapfel | last post by:
Hello PHP group, I have mysql running on a linux box. I have apache (2.0.4) running on a diff linux box. I have php 4.X. I can connect to the mysql db using odbc from a windows box, but cannot connect to the remote db from web server box (linux) to mysql database (another linux box). Apache is on RH Enterprise 3.0, mysql is on slacware (2.4.22 kernel). I am using php, require_once('DB.php'), and the dsn style connect string:...
5
2445
by: lwoods | last post by:
When I execute the following script I can connect using 'mysqli_connect' but I get a "DB Error: Not Found" when I display the $db->Message() after attempting the DB::Connect. And, "yes", the "restaurant" database does exist. Where should I start looking? PHP 5.0.4 / mySQL 4.1.13-nt / IIS / XP Pro
3
1100
by: MadCrazyNewbie | last post by:
Hey Again Group, Sorry to be a pain:( On my App I have serveral forms All with a Database Connection, and then Several Data Adapters. Is this the best way to do it? i.e have a seperate DataBase Connection on each form, or should I have one Public one?
2
1372
by: gavino | last post by:
http://philip.greenspun.com/wtr/aolserver/introduction-1.html reading this stuff and aolserver+tcl seemed to have some amazing features Why You'd Want to Use AOLserver AOLserver delivers the following features and benefits: faster, more reliable, more maintainable scripting pooled connections to relational database management systems single Unix process gives programmers the ability to cache files or
3
5236
by: Gregor =?UTF-8?B?S292YcSN?= | last post by:
Hi! Is it possible to alter tablespace so that you don't connect to the database? The problem I have is this. I got a DB backup from a machine with 16 Gb of RAM. There was a bufferpool set to use 10 Gb of RAM. Now I have to put it on a machine with only 8 Gb of RAM. The restore is OK, but I'd like to decrease that bufferpool to only use 4 Gb. Best regards,
1
3860
by: MackTheKnife | last post by:
I'm trying to get into an installation of v.6.5 to use with another server and I need the following information: Database hostname Database name Database usernane Database password Is this information available anyplace within the installation files? I'm not asked for uname and pwd to get into the database.
9
2564
by: Peter Lux | last post by:
I'm fairly new to c#, but not new to programming. I'm tasked with rewriting our Gupta/Sqlwindows apps (5 years worth of development) in dot Net. The main reason is that virtually no one knows the language, which is unfortunate because it's very simple to get windows created and rolled out. I downloaded C# (orcas) express and had created a SqlServer 2005 database (locally, ie not on a server) and moved some of our production data into it...
1
1654
by: pravinkedia | last post by:
When I am trying to connect to DB2 using, db2 connect to <database name> is giving error "DB2 Shared memory insufficient" So I tried to change(increase) the kernal values of shmmax, shmmin etc. Also, when I try to db db2start, now it has started to give errors such as "unresolved symbols" Pls help urgently with any ideas to resolve this. DB2 version is 8.1 FP7.
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8339
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8751
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8535
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2757
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.