[PHP] Function call stack

2002-01-30 Thread Christian Novak

Has anyone an idea on how to get information from PHP on the function call
stack.
I need the line number and file calling a function for a custom error
handler.

To be more clear, here is what I would like to do:

- I have a library, included in the main program
- I have an error handler in the library

// main.php
require "library.php";
$x = myfunc('A');


// library.php
function myfunc($i)
{
if (!is_int($i)) {
   $file =   // how can I get the file name of the file
calling myfunc()
   $line =  // how can I get the line number of the file
calling myfunc()
   trigger_error("Error in  $file, at line $line, paramter must be an
integer!", E_USER_ERROR);
return($i);

Using the pre_defined varibales __line__ and __file__ will always point me
to the function not the calling
script.

Best regards

Christian Novak



-- 
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] Re: mysql_insert_id?

2002-02-21 Thread Christian Novak

"Wee Chua" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
> Is it possible that I would get the wrong ID (Not the ID I just inserted
in
> Auto_Increment field) by using mysql_insert_id function if someone is also
> inserting record at the same time? How does mysql_insert_id work
accurately?
>
> Thanks,
> Wee

You can get the last auto_inc with the following query:
"SHOW TABLE STATUS 'my_table_having_an_autoinc'"
and then lookup the field "Auto_increment" in the result set.

Best regards

Christian




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Crashing a webserver

2002-02-21 Thread Christian Novak

There is a tool from Microsoft to do exactly this:
http://webtool.rte.microsoft.com
Christian

"Theodore Brinkman" <[EMAIL PROTECTED]> schrieb im
Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Pull the plug?  :)
>
> -Original Message-
> From: Chris Lott [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 19, 2002 1:28 PM
> To: Ruben Vermeersch
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Crashing a webserver
>
>
>
> > I have got the task to down our webserver, to see how stable she is, and
> how
> > easy/hard it is to get it on it's knees ;)
> >
> > Does anyone have some ideas how to do it?
>
> There are various useful "torture" scripts floating around the web that
you
> can use to create heavy, somewhat radom loads on a server, as well as to
> send large chunks of random data, etc... a few quick links that might
help:
>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php