4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Interpreting error messages
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Hertzsprung
WebHelper
WebHelper


Joined: 30 Jul 2002
Posts: 56
Location: UK

PostPosted: Fri Feb 28, 2003 8:38 am (21 years, 1 month ago) Reply with QuoteBack to Top

When a DB returns an error, it may be that you want to catch it and take some action. For example, if an attempt was made to insert a non-unique value in a unique column. Is there a better way of interpreting the DB errors than just reading an error string, which will be server-specific and entirely possible to change between DB versions?

Hertzsprung
OfflineView User's ProfileFind all posts by HertzsprungSend Personal MessageVisit Poster's Website
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Fri Feb 28, 2003 4:30 pm (21 years, 1 month ago) Reply with QuoteBack to Top

Well isn't that the kind of thing database abstraction layers do (info on them at http://www.4webhelp.net/tutorials/php/phplib_db.php )? If you put all your database code through a database abstraction layer, you shouldn't have to worry about errors, since this layer will deal with the errors on its own, regardless of the database type.

________________________________
Image

Last edited by Daniel on Fri Mar 07, 2003 4:15 pm, edited 1 time in total
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Hertzsprung
WebHelper
WebHelper


Joined: 30 Jul 2002
Posts: 56
Location: UK

PostPosted: Fri Mar 07, 2003 1:03 pm (21 years, 1 month ago) Reply with QuoteBack to Top

Daniel wrote:
Well isn't that the kind of thing database abstraction layers do (info on them at http://www.4webhelp.net/tutorials/php/phplib_db.php )? If you put all your database code through a database abstraction layer, you shouldn't have to worry about errors, since this layer will deal with the errors on its own, regardless of the database type.


That link is dead. And the reason why I wanted to know is because I'm writing my own abstraction layer! Smile
OfflineView User's ProfileFind all posts by HertzsprungSend Personal MessageVisit Poster's Website
drathbun
WebHelper
WebHelper


Joined: 01 Mar 2003
Posts: 69
Location: Texas

PostPosted: Fri Mar 07, 2003 2:10 pm (21 years, 1 month ago) Reply with QuoteBack to Top

Hertzsprung wrote:
That link is dead. And the reason why I wanted to know is because I'm writing my own abstraction layer! Smile


Just take off the closing )? that phpBB so thoughtfully added to the url for you, as in:

http://www.4webhelp.net/tutorials/php/phplib_db.php

Dave

________________________________
Dave
Photography Site :: Query Tools Forum :: Weekend Fun
OfflineView User's ProfileFind all posts by drathbunSend Personal MessageVisit Poster's Website
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Fri Mar 07, 2003 4:16 pm (21 years, 1 month ago) Reply with QuoteBack to Top

Sorry about that. I've now edited my post.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Hertzsprung
WebHelper
WebHelper


Joined: 30 Jul 2002
Posts: 56
Location: UK

PostPosted: Sat Mar 08, 2003 6:16 pm (21 years, 1 month ago) Reply with QuoteBack to Top

I'm writing more of a DB + SQL abstraction Surprised
OfflineView User's ProfileFind all posts by HertzsprungSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.115482 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme