PDA

Click to See Complete Forum and Search --> : or die() question


sam0010
Aug 7th, 2002, 08:46 AM
hello

i have seen "or die()" used in many examples and i am just wondering how this is used. It looks like something that can be very useful. When is the die() function executed and under what conditions.. also can the die() function be any peace of code.. like "echo()" or "something = something".

thank you

cpradio
Aug 7th, 2002, 08:55 AM
the die() function is executed when a statement is false.
So any function/statements that can produce a false value/return can have the die() function attached to it.

phpman
Aug 7th, 2002, 01:14 PM
and if I remember right the die() function only writes to the error.log file on the server as it won't spit out any for the user except the usual, cannot connect error. the die function will write (sometimes in detail) on what the error was.