[PHP] print_r style array content

2001-04-18 Thread Chien-pin Wang


Dear All,

I wonder if there is a php function that could return content
of an array, in print_r style, as a string. I need to get it and
send as debug information. If not, is there a workaround or
alternative, other than writing a function? Many thanks.

Chien-pin


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] oracle last inserted

2001-03-25 Thread Chien-pin Wang


If you use sequence to generate your last_inserted_id, then you can always
get that ID by calling

SELECT sequence_name.CURRVAL
FROM DUAL;

within the same session.

Chien-pin

On Sun, 25 Mar 2001, almir wrote:

> is there a way to get last inserted id from oracle as
> mysql_inerted_id() or
> SELECT @@IDENTITY AS LastId
> in mssql server
> 
> i have a function that does only that, takes insert statement and returns
> last id,  but this function have to work for all tables (different triggers
> in oracle) , right now the only thing i can imagine is to give this function
> the name of ID column and read name of table with regex and then do
> select max(parametar_id) from regex_table
> and then to do commit ,
> this way is somehow realy stupid but is my only solution in this moment so
> if you have any better ideas plese help
> 
> almir
> 
> 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] The right way to include class files?

2001-03-19 Thread Chien-pin Wang


Dear all,

Attached are three files I used to demonstrate the problem I'm
troubled with. Some experiments may be required to see the problem.

To put the problem in short, I'd like to ask what the proper way is to
include classA and classB in order to make test.php work? In the attached
file, I have included both class files in test.php and it works
properly. However, in real case, the caller of classB may not know the
relationship between classA and classB. So including classA from within
classB makes more sense. In that case, PHP throws Fatal Error: No parent
class available in this context., when running test.php.

ClassB is extended from classA, and re-implements method A1 as a
wrapper function to method A1 found in its parent, classA. Use
$this->A1("ABC", "DEF") can get away from the fatal error, but runs into
core dump because it calls itself undefined number of times. So, let me
re-phrase my problem: Do I need to include all inheriting class files in
the caller program (like test.php) in order to make the construct of
re-implementing a wrapping function works?

Thank you for reading this far. I wish I've explained my problem clear
enouth and someone can kindly pick it up from there. Thanks again.

Chien-pin


#!/usr/local/bin/php -q


include("/home/cpw/classA.class");
include("/home/cpw/classB.class");
$obj=new B;
$obj->A1();
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP] The right way to include class files?

2001-03-19 Thread Chien-pin Wang


Dear all,

Attached are three files I used to demonstrate the problem I'm
troubled with. Some experiments may be required to see the problem.

To put the problem in short, I'd like to ask what the proper way is to
include classA and classB in order to make test.php work? In the attached
file, I have included both class files in test.php and it works
properly. However, in real case, the caller of classB may not know the
relationship between classA and classB. So including classA from within
classB makes more sense. In that case, PHP throws Fatal Error: No parent
class available in this context., when running test.php.

ClassB is extended from classA, and re-implements method A1 as a
wrapper function to method A1 found in its parent, classA. Use
$this->A1("ABC", "DEF") can get away from the fatal error, but runs into
core dump because it calls itself undefined number of times. So, let me
re-phrase my problem: Do I need to include all inheriting class files in
the caller program (like test.php) in order to make the construct of
re-implementing a wrapping function works?

Thank you for reading this far. I wish I've explained my problem clear
enouth and someone can kindly pick it up from there. Thanks again.

Chien-pin



#!/usr/local/bin/php -q


include("./classA.class");
include("./classB.class");
$obj=new B;
$obj->A1();
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP] Where is my parent?

2001-03-15 Thread Chien-pin Wang


Dear All,

Is there a way to re-write a method in parent class and still access
the parent class by parent::method()?

I have a class (classChild) extended from another class
(classParent). In classChild I have re-implemented method foo() as a
wrapper function of method foo() in classParent. Method foo() in
classChild calls method foo() in classParent by parent::foo().

The scheme works out fine when I test it by writing a shell script
that runs a CGI version of php. But when I run it through apache module, I
got a fatal error saying 'No parent class available in this context'. I
have made sure the parent class file is included, and the classChild
'EXTENDS' the classParent. Now, where is my parent?

Thanks in advance for any comment and suggestion.

Chien-pin

P.S.: PHP CGI version is 4.0.2, apache module version is 4.0.4pl1


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Wierd OCI Problem... [Urgent, and please help]

2001-02-08 Thread Chien-Pin Wang


Dear all,

 My server is running RedHat6.2/Apache 1.3.14/PHP 4.0.4pl1/Oracle
8.0.5. The way I make connection from PHP to Oracle is through php's
Oracle 8 extension OCIPLogon.

 Since the server was made available to the public, *EVERY ONCE A
WHILE* I got error messages logged in apache's error log as found in the
attachement (sorry the oracle message is in Big5 characters). The error
sequence starts with ORA-00022, saying 'invalid session id; access
denied', but a connection resource is returned. Then all kinds of
ORA-/PLS- errors come after it. The persistent connection affects only the
attached apache process, not everyone. That explains when user reload the
page, the problem cannot be reproduced everytime. The only way I've found
to stop it is by restarting apache.

 I use quite a lot of Oralce stored procedures and return query
results by cursor variables. But I doubt this the reason to it. My guess
is that somewhere between apache process and oracle connection is
interrupted.

 I've been working on this issue for a while but got no clue now to
move any further. When errors come, the error log got filled up pretty
quick. Please help.., and thanks in advance.

Chien-pin




[Fri Feb  9 10:01:06 2001] [error] PHP Warning:  OCIStmtExecute: ORA-00022: ¶¥¬q§@·~ 
ID µL®Ä; µLªk¦s¨ú
 in /home/httpd/htdocs/veryWed/php/modules//class/dataPack2.class on line 38
[Fri Feb  9 10:01:06 2001] [error] PHP Warning:  OCIFetchInto: OCI_INVALID_HANDLE in 
/home/httpd/htdocs/veryWed/php/modules//class/dataPack2.class on line 41
[Fri Feb  9 10:01:06 2001] [error] PHP Warning:  OCIStmtExecute: ORA-06550: ²Ä 1 ¦æ, 
²Ä 28 ­ÓÄæ¦ì: 
PLS-00103: µo²{¤F²Å¸¹ ")" ·í±zµ¥«Ý¤U¦C¨Æ¶µ¤§¤@µo¥Í®É¡G
 := . ( @ % ;
²Å¸¹ "(" ¨ú¥N¤F ")" ¤~¥i¥HÄ~Äò§@·~¡C
 in /home/httpd/htdocs/veryWed/php/modules//class/dataPack2.class on line 96
[Fri Feb  9 10:01:06 2001] [error] PHP Warning:  failed to rollback outstanding 
transactions!: ORA-00022: ¶¥¬q§@·~ ID µL®Ä; µLªk¦s¨ú
 in /home/httpd/htdocs/veryWed/php/modules//component/searchArticle_long on line 32
[Fri Feb  9 10:01:21 2001] [error] PHP Warning:  OCIStmtExecute: ORA-00022: ¶¥¬q§@·~ 
ID µL®Ä; µLªk¦s¨ú
 in /home/httpd/htdocs/veryWed/php/modules//class/dataPack2.class on line 38
[Fri Feb  9 10:01:21 2001] [error] PHP Warning:  OCIFetchInto: OCI_INVALID_HANDLE in 
/home/httpd/htdocs/veryWed/php/modules//class/dataPack2.class on line 41
[Fri Feb  9 10:01:21 2001] [error] PHP Warning:  OCIStmtExecute: ORA-06550: ²Ä 1 ¦æ, 
²Ä 28 ­ÓÄæ¦ì: 
PLS-00103: µo²{¤F²Å¸¹ ")" ·í±zµ¥«Ý¤U¦C¨Æ¶µ¤§¤@µo¥Í®É¡G
 := . ( @ % ;
²Å¸¹ "(" ¨ú¥N¤F ")" ¤~¥i¥HÄ~Äò§@·~¡C
 in /home/httpd/htdocs/veryWed/php/modules//class/dataPack2.class on line 96
[Fri Feb  9 10:01:21 2001] [error] PHP Warning:  failed to rollback outstanding 
transactions!: ORA-00022: ¶¥¬q§@·~ ID µL®Ä; µLªk¦s¨ú
 in /home/httpd/htdocs/veryWed/php/modules//component/searchArticle_long on line 32


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP] what is ::?

2001-02-07 Thread Chien-pin Wang


Dear all,

Pardon me if this is explained somewhere in the
documentation. I've found the :: notation (double colons) in class
definitions of PHP's ~/lib/php directory, such as DB.php. It looks like
doing the same thing as -> notation. Can someone help to explain this a
little bit or provide links to the explaination? Thanks a lot!

Chien-pin


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Generic cloner?

2001-02-05 Thread Chien-pin Wang


Hi,

I'm wondering if there is an easy way to code a generic cloner at top
level of object inheritance tree so that all descendents can follow? Or by
nature the clone() function needs be implemented at final class
def.? Thanks a lot!

Chien-pin


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] HTML source in Apache error log

2001-01-17 Thread Chien-pin Wang


Dear All,

  Lately I've noticed that my Apache error logs were filled up with HTML
sources. Logs grow rapidly and I have to clean it every once a while. Is
that caused by any particular PHP error? Normally I should have just one
line per error, shouldn't I? Is there a way to trace or turn it off (stop
dumping HTML sources to error log)? Thanks for any comments!

Chien-pin


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]