Jump to content

dilong

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by dilong

  1. Hi, I was thinking that using the easy connect naming method in oci_connect does not require a running tnslsnr!? Am I wrong? I tried: $db = '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = my-ora-host.example.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = my-service.example.com)))'; // $db = '//my-ora-host.example.com:1521/my-service.example.com'; $ora_conn = oci_connect('test', 'test', $db); Using both versions of the 'db' I receive the error: mod_fcgid: stderr: PHP Warning: oci_connect(): ORA-12541: TNS:no listener in .... I am using a self compiled PHP 5.3.8 using Oracles instantclient 11.2.0.3.0 (on Linux, 32bit). There are NO special environment variables ( like ORACLE_HOME or TNS_ADMIN), because I was thinking that I don't need them... Am I wrong? Is a running tnslsnr always required? Or am I doing wrong in specifying the connection string? Any help is appreciated! chuan P.S.: Yes I read http://www.phpfreaks.com/forums/index.php?topic=196014.0, but it doesn't help.
  2. Hm, does 'for' require the expression3 to have a return value at 'compile' time? This can't be! But the answer seems to be correct! When I try to use 'unset' instead of 'echo' I receive: syntax error, unexpected T_UNSET, expecting ')' Funny. Is there a reason for this?
  3. You are correct, there are many ways to avoid that problem/bug or whatever this is. I just noticed that behaviour and was wondering WHY this happen! (Actually I was writing something like "for($i=0; $i<5; echo $vara, $varb, $i++);" and received that same error.)
  4. Hi! I wonder why this code is working: for($i=0; $i<5; print $i++); while this code: for($i=0; $i<5; echo $i++); gives the error PHP Parse error: syntax error, unexpected T_ECHO, expecting ')' After spending some hours at php.net I learned that both calls ('echo' and 'print') are not real functions, but I wonder why they behave so different in the same context?! Also 'tricks' like for($i=0; $i<5; (echo $i), $i++); do not work. Is 'echo' just forbidden in that particular case? Best regards!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.