Re: [PHP] function returning true or errors

2002-04-18 Thread Jason Wong
On Thursday 18 April 2002 23:25, Erik Price wrote: I am writing a function that performs some actions. I would like to return true if the actions succeed, or return an error message if the actions fail. How should I go about it? The following code doesn't do it, because the returned error

RE: [PHP] function returning true or errors

2002-04-18 Thread SHEETS,JASON (Non-HP-Boise,ex1)
Rather than using true and false you can use 1, 0 it saves key strokes, reduces script size, etc Also use ' instead of if you don't need it evaluated by PHP. if (custom_function) { print 'Custom Function succeeded!'; } else { print 'There was a problem!'; } One thing I've

Re: [PHP] function returning true or errors

2002-04-18 Thread Erik Price
On Thursday, April 18, 2002, at 11:56 AM, Jason Wong wrote: What I tend to do is define functions like so: function doo($dah, $dib, $error) { ... I had not even thought about passing an extra parameter by reference -- great idea. Erik Erik Price Web Developer Temp Media