Re: [PHP] Error handling strategies (db related)

2010-04-28 Thread Pete Ford
On 27/04/10 16:37, tedd wrote: Error handling is almost an art form. More like a black art - voodoo perhaps... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Error handling strategies (db related)

2010-04-28 Thread viraj
On Tue, Apr 27, 2010 at 7:34 PM, Gary . php-gene...@garydjones.name wrote: On Tue, Apr 27, 2010 at 10:46 AM, Peter Lind wrote: On 27 April 2010 10:42, Gary . wrote: How do you guys handle errors during, say, db insertions. Let's say you have an ongoing transaction which fails on the n-th

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Peter Lind
On 27 April 2010 10:42, Gary . php-gene...@garydjones.name wrote: How do you guys handle errors during, say, db insertions. Let's say you have an ongoing transaction which fails on the n-th insert. Ok, you roll back the transaction, no problem. How do you then inform the user? Just using the

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Michiel Sikma
On 27 April 2010 10:42, Gary . php-gene...@garydjones.name wrote: How do you guys handle errors during, say, db insertions. Let's say you have an ongoing transaction which fails on the n-th insert. Ok, you roll back the transaction, no problem. How do you then inform the user? Just using the

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Paul M Foster
On Tue, Apr 27, 2010 at 10:42:03AM +0200, Gary . wrote: How do you guys handle errors during, say, db insertions. Let's say you have an ongoing transaction which fails on the n-th insert. Ok, you roll back the transaction, no problem. How do you then inform the user? Just using the text

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Peter Lind
On 27 April 2010 15:36, Paul M Foster pa...@quillandmouse.com wrote: On Tue, Apr 27, 2010 at 10:42:03AM +0200, Gary . wrote: How do you guys handle errors during, say, db insertions. Let's say you have an ongoing transaction which fails on the n-th insert. Ok, you roll back the transaction,

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Gary .
On Tue, Apr 27, 2010 at 10:46 AM, Peter Lind wrote: On 27 April 2010 10:42, Gary . wrote: How do you guys handle errors during, say, db insertions. Let's say you have an ongoing transaction which fails on the n-th insert. Ok, you roll back the transaction, no problem. How do you then inform

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Paul M Foster
On Tue, Apr 27, 2010 at 03:41:04PM +0200, Peter Lind wrote: On 27 April 2010 15:36, Paul M Foster pa...@quillandmouse.com wrote: On Tue, Apr 27, 2010 at 10:42:03AM +0200, Gary . wrote: How do you guys handle errors during, say, db insertions. Let's say you have an ongoing transaction

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Peter Lind
On 27 April 2010 16:07, Paul M Foster pa...@quillandmouse.com wrote: On Tue, Apr 27, 2010 at 03:41:04PM +0200, Peter Lind wrote: On 27 April 2010 15:36, Paul M Foster pa...@quillandmouse.com wrote: On Tue, Apr 27, 2010 at 10:42:03AM +0200, Gary . wrote: How do you guys handle errors

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Paul M Foster
On Tue, Apr 27, 2010 at 04:13:20PM +0200, Peter Lind wrote: On 27 April 2010 16:07, Paul M Foster pa...@quillandmouse.com wrote: On Tue, Apr 27, 2010 at 03:41:04PM +0200, Peter Lind wrote: On 27 April 2010 15:36, Paul M Foster pa...@quillandmouse.com wrote: On Tue, Apr 27, 2010 at

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Peter Lind
On 27 April 2010 16:24, Paul M Foster pa...@quillandmouse.com wrote: On Tue, Apr 27, 2010 at 04:13:20PM +0200, Peter Lind wrote: On 27 April 2010 16:07, Paul M Foster pa...@quillandmouse.com wrote: On Tue, Apr 27, 2010 at 03:41:04PM +0200, Peter Lind wrote: On 27 April 2010 15:36, Paul M

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Nathan Rixham
Peter Lind wrote: On 27 April 2010 16:24, Paul M Foster pa...@quillandmouse.com wrote: On Tue, Apr 27, 2010 at 04:13:20PM +0200, Peter Lind wrote: On 27 April 2010 16:07, Paul M Foster pa...@quillandmouse.com wrote: On Tue, Apr 27, 2010 at 03:41:04PM +0200, Peter Lind wrote: On 27 April

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Teus Benschop
I'm still shocked you guys are still writing code that has errors in it, what's worse is you know about the errors, and instead of fixing them you're just telling the user about it! The point here is that we, programmers, know that we write code with bugs in it. We are realistic about it,

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread tedd
At 9:36 AM -0400 4/27/10, Paul M Foster wrote: On Tue, Apr 27, 2010 at 10:42:03AM +0200, Gary . wrote: How do you guys handle errors during, say, db insertions. Let's say you have an ongoing transaction which fails on the n-th insert. Ok, you roll back the transaction, no problem. How do

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Nathan Rixham
Teus Benschop wrote: I'm still shocked you guys are still writing code that has errors in it, what's worse is you know about the errors, and instead of fixing them you're just telling the user about it! The point here is that we, programmers, know that we write code with bugs in it. We are

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread tedd
At 4:13 PM +0200 4/27/10, Peter Lind wrote: If only the world consisted of smart users ... I think, however, that we're generally closer to the opposite. And no, I don't hate users - I've just seen too many people do things that were very far removed from smart. Regards Peter Peter et al:

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread tedd
At 10:24 AM -0400 4/27/10, Paul M Foster wrote: Unfortunately, true. Sometimes I think computer users should be required to take a course in using a computer before being allowed behind the keyboard. Paul Yeah, like I believe that everyone should do through at least one divorce before

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Ashley Sheridan
On Tue, 2010-04-27 at 12:12 -0400, tedd wrote: At 4:13 PM +0200 4/27/10, Peter Lind wrote: If only the world consisted of smart users ... I think, however, that we're generally closer to the opposite. And no, I don't hate users - I've just seen too many people do things that were very far

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread tedd
At 4:31 PM +0200 4/27/10, Peter Lind wrote: While I love to rant at stupid users, the truth is probably that programmers are the ones who should take courses in how users think. In the end, if I fail to understand my users, it doesn't matter how great my program is: they'll still fail to use it.

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread tedd
At 4:23 PM +0100 4/27/10, Nathan Rixham wrote: I'm still shocked you guys are still writing code that has errors in it, what's worse is you know about the errors, and instead of fixing them you're just telling the user about it! :p Here's my code that doesn't contain errors: ?php ?

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Peter Lind
On 27 April 2010 18:21, tedd tedd.sperl...@gmail.com wrote: At 4:31 PM +0200 4/27/10, Peter Lind wrote: While I love to rant at stupid users, the truth is probably that programmers are the ones who should take courses in how users think. In the end, if I fail to understand my users, it

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread tedd
At 5:09 PM +0100 4/27/10, Ashley Sheridan wrote: Sounds like you've got a few stories that would a lot of people happy were you to share them on the DailyWTF ;) Thanks, Ash Ash: Sharing them here is more direct and meaningful to what we do, but I will investigate what you suggest.

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Paul M Foster
On Tue, Apr 27, 2010 at 12:12:31PM -0400, tedd wrote: At 4:13 PM +0200 4/27/10, Peter Lind wrote: If only the world consisted of smart users ... I think, however, that we're generally closer to the opposite. And no, I don't hate users - I've just seen too many people do things that were very

RE: [PHP] Error handling strategies (db related)

2010-04-27 Thread Tommy Pham
At 10:24 AM -0400 4/27/10, Paul M Foster wrote: Unfortunately, true. Sometimes I think computer users should be required to take a course in using a computer before being allowed behind the keyboard. Paul I came across a term long ago amidst my readings: PEBKAC Problem Exists Between Keyboard

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Gary .
On 4/27/10, tedd wrote: At 4:23 PM +0100 4/27/10, Nathan Rixham wrote: I'm still shocked you guys are still writing code that has errors in it, what's worse is you know about the errors, and instead of fixing them you're just telling the user about it! :p Here's my code that doesn't contain

Re: [PHP] Error handling strategies (db related)

2010-04-27 Thread Andrew Ballard
On Tue, Apr 27, 2010 at 12:23 PM, tedd tedd.sperl...@gmail.com wrote: At 4:23 PM +0100 4/27/10, Nathan Rixham wrote: I'm still shocked you guys are still writing code that has errors in it, what's worse is you know about the errors, and instead of fixing them you're just telling the user

Re: [PHP] Error handling (skip this message my mistake)

2008-03-11 Thread It Maq
Sorry, i found the error. it was my mistake - Original Message From: It Maq [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Tuesday, March 11, 2008 11:38:10 AM Subject: [PHP] Error handling Hi, I need help with a simple script that i made for handling errors. The problem is

Re: [PHP] Error Handling question

2007-08-07 Thread Richard Lynch
On Mon, August 6, 2007 4:41 am, debussy007 wrote: I am new to PHP and need some help for error handling. I read in the docs that i can handle the errors this way in my PhP: set_error_handler('errorHandler'); function errorHandler($errnum,$errmsg,$file,$lineno){ [...] } But does that

Re: [PHP] Error Handling question

2007-08-06 Thread brian
debussy007 wrote: Hi, I am new to PHP and need some help for error handling. I read in the docs that i can handle the errors this way in my PhP: set_error_handler('errorHandler'); function errorHandler($errnum,$errmsg,$file,$lineno){ [...] } But does that mean that I have to copy paste

Re: [PHP] Error handling

2007-03-01 Thread Richard Lynch
E_USER_WARNING is a 'constant' whose value is a number. It is not a string. If you do this: echo E_USER_WARNING is set to ', E_USER_WARNING, 'br /\n; you will see exactly what number it is. So whatever you thought was going wrong, this is not it. In addition... The check for $query should

Re: [PHP] Error handling for Memcached PHP Extension

2007-02-27 Thread Richard Lynch
Didja see this one: http://us3.php.net/manual/en/function.memcache-debug.php Not, perhaps, the best answer, and maybe even not possible in your environment, but it may be useful for development, if not production. You could also check the getServerStats functions to see if their stats provide

Re: [PHP] Error Handling Library?

2006-08-31 Thread Rafael Mora
Hi!, u can extend the exception class and handle ur own errors, If u need help let me know! Rafa On 8/31/06, Jay Paulson [EMAIL PROTECTED] wrote: I've been doing some research and was wondering if anyone out there has written a library for error handling? I haven't found anything as of yet

Re: [PHP] Error Handling Library?

2006-08-31 Thread Robert Cummings
On Thu, 2006-08-31 at 11:12 -0500, Jay Paulson wrote: I've been doing some research and was wondering if anyone out there has written a library for error handling? I haven't found anything as of yet but would love to hear suggestions! PEAR Cheers, Rob. --

Re: [PHP] Error Handling Library?

2006-08-31 Thread Martin Alterisio
I'm curious, what features are you looking for in an error handling library? 2006/8/31, Jay Paulson [EMAIL PROTECTED]: I've been doing some research and was wondering if anyone out there has written a library for error handling? I haven't found anything as of yet but would love to hear

Re: [PHP] error handling

2005-04-13 Thread Petar Nedyalkov
On Wednesday 13 April 2005 08:46, Cima wrote: hi, im working with php 4 and postgresql 8 and i would like to know how to handle certain errors generated. in postgresql, i've written a stored function that selects a record from a table and in case no record is found i 'raise an exception'.

RE: [PHP] error handling

2005-04-13 Thread Stephen March
Personally, I create a custom error handler for all my apps (currently 4.3.* compliant). While I normally use Smarty and have separate error templates, here is a quick example. function errorHandler($errno, $errstr, $errfile, $errline ) { print Error #: $errno br/Error Message:

RE: [PHP] Error Handling

2003-10-17 Thread Jay Blanchard
[snip] I have found some great code that handles errors through PHP_SELF However I have radio buttons and drop down selections that I cannot do a $_POST (the POST only works on my text fields). Does someone have some sample code that can check for errors on a drop down selection or radio buttons

Re: [PHP] Error Handling

2003-10-17 Thread Robert Cummings
On Fri, 2003-10-17 at 16:29, Frank Tudor wrote: I have found some great code that handles errors through PHP_SELF However I have radio buttons and drop down selections that I cannot do a $_POST (the POST only works on my text fields). Does someone have some sample code that can check for

Re: [PHP] Error Handling

2003-10-17 Thread John W. Holmes
Robert Cummings wrote: Error Handling?? Do you mean form validation? InterJinn does form validation and allows custom validators for any kind of form field. I believe PEAR's Quickform can also do similar. I'm thinking about getting a vasectomy; what does InterJinn recommend? Seriously, is it

Re: [PHP] Error Handling

2003-10-17 Thread Robert Cummings
On Fri, 2003-10-17 at 18:49, John W. Holmes wrote: Robert Cummings wrote: Error Handling?? Do you mean form validation? InterJinn does form validation and allows custom validators for any kind of form field. I believe PEAR's Quickform can also do similar. I'm thinking about getting a

Re: [PHP] Error Handling

2003-10-17 Thread John Nichel
John W. Holmes wrote: Robert Cummings wrote: Error Handling?? Do you mean form validation? InterJinn does form validation and allows custom validators for any kind of form field. I believe PEAR's Quickform can also do similar. I'm thinking about getting a vasectomy; what does InterJinn

Re: [PHP] Error Handling

2003-10-17 Thread Robert Cummings
On Fri, 2003-10-17 at 23:14, John Nichel wrote: I had InterJinn Simonize my car this morning. :) Hmm, that's an odd word to use... I hope your car enjoyed its simonizing. But don't let it get carried away :) Cheers, Rob -- .. |

Re: [PHP] Error Handling

2003-10-17 Thread Frank Tudor
Interjinn looks great but my development box is a windows me machine with easyphp (globals turned off) How am I supposes to get this stuff to work. I actually just unzipped it to my www dir and it has been sitting there the whole day. and I still have my vailidation (form handling) problem. I

Re: [PHP] Error Handling

2003-10-17 Thread Greg Beaver
Frank, http://pear.php.net/HTML_QuickForm It's that easy. There are full docs accessible from the page listed above. Average time from download to output of your first form with validation: 30 minutes to 1 hour. Tops. Regards, Greg Frank Tudor wrote: I would really be interested in

Re: [PHP] Error Handling

2003-10-17 Thread Robert Cummings
On Sat, 2003-10-18 at 00:07, Frank Tudor wrote: Interjinn looks great but my development box is a windows me machine with easyphp (globals turned off) How am I supposes to get this stuff to work. I actually just unzipped it to my www dir and it has been sitting there the whole day. and I

Re: [PHP] error handling

2003-06-19 Thread Jason Wong
On Friday 20 June 2003 02:11, Mignon Hunter wrote: On my dev server the php.ini is set to log all errors and notices. Isnt there a way to over ride this on a per script basis to output to stdout (or my browser) ? Yes, manual Error Handling and Logging Functions -- Jason Wong - Gremlins

Re: [PHP] Error handling with multiple file uploads and sql

2003-01-06 Thread Justin French
Why not split it into 2 forms? insert, then attach pictures to the record. Otherwise, decide what's the key issue (imho the a record can exist without pics, but not vice-versa), and focus on that first. Justin on 06/01/03 10:15 PM, Jim ([EMAIL PROTECTED]) wrote: Hi, I have the following

Re: [PHP] Error handling with multiple file uploads and sql

2003-01-06 Thread Jim
Why not split it into 2 forms? insert, then attach pictures to the record. Its just not user-friendly enough, I have thought about it though. I think I'd rather risk the script hitting an error than compromise the user-friendliness.after all, the chance of a file not saving is miniscule as

Re: [PHP] error handling

2002-11-17 Thread Rasmus Lerdorf
Try this. In your php.ini file: display_errors = Off log_errors = On track_errors = On Then in your code: $php_errormsg = false; ob_start(); ... your code ... if($php_errormsg) { ob_end_clean(); // Error - discard buffer echo An error occurred - webmaster notified; }

Re: [PHP] Error Handling Class - Any Recommendations?

2002-04-18 Thread Erik Price
On Thursday, April 18, 2002, at 08:53 AM, Julio Nobrega Trabalhando wrote: Anyone recommend a good one? I am in need of the following features: 1) Catch any type of errors, 2) Actions like: Show on the screen, log on a file or database, or email, 3) Different actions for each error

Re: [PHP] Error Handling!

2002-03-12 Thread Jan Rademaker
On Tue, 12 Mar 2002, Thomas Edison Jr. wrote: I want errors reported on a page when the mail() function for any reason fails to send emails. FOr example, if there is a malformed email address or anything, and the mail is not sent, how can i catch the Error and Display it on the page? the

Re: [PHP] Error Handling!

2002-03-12 Thread David Robley
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I want errors reported on a page when the mail() function for any reason fails to send emails. FOr example, if there is a malformed email address or anything, and the mail is not sent, how can i catch the Error and Display it on the

Re: [PHP] Error handling

2001-12-18 Thread Neil Freeman
What warnings are you receiving? Many can be avoided by doing various checks: e.g. if (!isset($some_variable)) ...some error code else ...all is well others which may be useful: function_exists() file_exists() HTH Neil Yoel Benitez Fonseca wrote: Hi! There is in PHP some way

Re: [PHP] error handling and __LINE__

2001-11-27 Thread SafeV
Thanks, assert() is cool, but it still reports the filename and line number of the included file with the function in which the error occurred, not the script that called the functon with illegal arguments. Or...??? Eg.: index.php: ? include_once(functions.php); // foo() is declared here

Re: [PHP] error handling and __LINE__

2001-11-22 Thread Papp Gyozo
try, assert() instead of echo()ing error messages. assert('is_object($obj)'); and write your error handler code or use mine :) or am i missing something? Papp Gyozo - [EMAIL PROTECTED] - Original Message - From: SafeV [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent:

RE: [PHP] Error Handling class

2001-04-12 Thread Taylor, Stewart
the PEAR library has an error class -Stewart. -Original Message- From: Boget, Chris [mailto:[EMAIL PROTECTED]] Sent: 12 April 2001 16:19 To: Php (E-mail) Subject: [PHP] Error Handling class I've looked around but haven't really found one... Does anyone know where I can find a class

Re: [PHP] error handling

2001-02-14 Thread David Robley
On Thu, 15 Feb 2001 11:42, Patrick Brown wrote: How can I disable the display of error to the browser window from within the script? I want to do a redirect based on the error and cannot because header info has already been sent. Thanks, Pat Try an @ prepended to the function that triggers

Re: [PHP] error handling

2001-02-14 Thread CC Zona
In article 96faad$h9k$[EMAIL PROTECTED], [EMAIL PROTECTED] ("Patrick Brown") wrote: How can I disable the display of error to the browser window from within the script? I want to do a redirect based on the error and cannot because header info has already been sent. Use the "@" sign. Example

Re: [PHP] error handling

2001-02-14 Thread Patrick Brown
OK, I tried the @ symbol. It seemed to just disable error checking altogether. I have this in my code that I'd like to use. if (!$php_errormsg) { header("Location: http://www.domain.com/admin/index.php"); } else { header("Location: http://www.domain.com/admin/error.html"); } "CC Zona" [EMAIL