RE: Oh what a fool I am (Oracle/PHP connection)

From: Date: Fri, 03 Nov 2000 16:14:24 +0000
Subject: RE: Oh what a fool I am (Oracle/PHP connection)
Groups: php.windows 
Request: Send a blank email to php-windows+get-3671@lists.php.net to get a copy of this message
I've been having a simliar problem of sorts... in fact, I don't even think that OCILogoff even works when established with OCIPLogon... --------------------- Founder of The 'What Kind of Idiot Uses PHP with IIS with Oracle on NT?' Consortium Members: John Asendorf, Thomas Kryger, Florian Clever, Ron Woods John Asendorf - jasendorf@lcounty.com Web Applications Developer http://www.lcounty.com <http://www.lcounty.com/> - NEW FEATURES ADDED DAILY! Licking County, Ohio, USA 740-349-3631 -----Original Message----- From: Mustafa SARI [mailto:msari@fatih.edu.tr] Sent: Friday, November 03, 2000 11:02 AM To: Andy Hoffman; Vince LaMonica; jasendorf@lcounty.com Cc: php-windows@lists.php.net Subject: Re: Oh what a fool I am (Oracle/PHP connection) Hi to all Thanks to you too Andy. Firstly I wanna say that I agree with you. Php manual page forced us to make this fault and wanna ask a question about how to keep persistent connection on php pages using oracle ( ocilogon lets people to access their rights , informations, pages while skipping other pages or log off the user without logging of by ocilogoff) . How to keep an oracle log when passing to another page.? (most stable, secure , easiest way) php oci8 functions do this by default , should we use session functions or cookies ??? and also I am from Turkiye (Turkey) ----- Original Message ----- From: "Andy Hoffman" < <mailto:andy.hoffman@bms.com> andy.hoffman@bms.com> To: "Vince LaMonica" < <mailto:Vince.LaMonica@quest.com> Vince.LaMonica@quest.com>; "Mustafa SARI" < <mailto:msari@fatih.edu.tr> msari@fatih.edu.tr>; < <mailto:jasendorf@lcounty.com> jasendorf@lcounty.com> Cc: < <mailto:php-windows@lists.php.net> php-windows@lists.php.net> Sent: Friday, November 03, 2000 5:24 PM Subject: Oh what a fool I am (Oracle/PHP connection) > Folks, > > A bright new light has dawned in the "figuring out how to > use oci8 & php". For a while, Vince and I have been helping > folks get oci8 working under php4... well, all that time, I > was maintaining that the php oci8 connection call (ocilogon > or ociplogon) had to be made with the following syntax > (based on the php manual, of course): > > ocilogon("<username>", "<passwd>", "<SID>"); > > Replacing the username, password and SID, of course, to > match those specified in Net8 Assistant and the database > server. However, that's not quite right... and this was > brought to light by the good fortune of Mustafa Sari (a > student in Portugal whom I was assisting this week). We > were having the hardest time getting his Oracle 8.1.6 client > to connect within PHP, and one of the reasons, I thought, > was because his Service Name (left hand tree-view in Net8 > Assistant) did not match the specified SID for that > particular database instance. I previously figured that the > Service Name prefix (mysid in mysid.world, for instance) > MUST match the SID (MYSID for this example) specified using > Release 8.0 Compatibility. > > Well, from what Mustafa discovered today... 1) the Service > Name in the left panel does not necessarily have to match > the specified SID, and more importantly 2) the name used by > ocilogon (what was previously noted as SID) is in fact the > service name prefix and NOT the SID. Here's two examples of > tnsnames.ora files to demonstrate what I'm getting at > (connection code to follow)... > > #1 - Service Name prefix matches SID > > MYSID.WORLD = > (DESCRIPTION = > (ADDRESS_LIST = > (ADDRESS = (PROTOCOL = TCP) > (HOST = someserver.mycompany.com) > (PORT = 1521)) > ) > (CONNECT_DATA = > (SID = MYSID) > ) > ) > > #2 - Service Name prefix different than SID > > TEST.WORLD = > (DESCRIPTION = > (ADDRESS_LIST = > (ADDRESS = (PROTOCOL = TCP) > (HOST = someserver.mycompany.com) > (PORT = 1521)) > ) > (CONNECT_DATA = > (SID = MYSID) > ) > ) > > In example #1, which was the previous "only works this way" > recommendation, the correct connection call would look like: > > ocilogon("scott","tiger","MYSID"); > > ... which looked like the normal way of connecting via an > SID, right? Well, for example #2, you would only be able to > connect successfully via this connection call: > > ocilogon("scott","tiger","TEST"); > > And thus the discovery that indeed, ocilogon calls within > PHP are made using the Service Name prefix, and NOT the > SID. Test it and see for yourself, but we're definitely > chalking this one up as one of the trickier tricks in the > OCI8 wars. Just thought you all might like to know about > it. And if anyone finds anything different, or if I'm just > blowing smoke, let me know. > > Vince, this is definitely one for the How-to... and thanks, > Mustafa! You definitely made my morning :) > > -- > Andy Hoffman > Web Developer > Bristol-Myers Squibb > email: <mailto:andy.hoffman@bms.com> > andy.hoffman@bms.com >

« previous php.windows (#3671) next »