|
Author |
Message |
Hertzsprung
WebHelper

Joined: 30 Jul 2002
Posts: 56
Location: UK
|
Posted:
Fri Feb 28, 2003 8:38 am (22 years, 1 month ago) |
  |
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 |
|
|
     |
 |
Daniel
Team Member


Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Fri Feb 28, 2003 4:30 pm (22 years, 1 month ago) |
  |
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. |
________________________________

Last edited by Daniel on Fri Mar 07, 2003 4:15 pm, edited 1 time in total |
|
    |
 |
Hertzsprung
WebHelper

Joined: 30 Jul 2002
Posts: 56
Location: UK
|
Posted:
Fri Mar 07, 2003 1:03 pm (22 years, 1 month ago) |
  |
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!  |
|
|
     |
 |
drathbun
WebHelper

Joined: 01 Mar 2003
Posts: 69
Location: Texas
|
Posted:
Fri Mar 07, 2003 2:10 pm (22 years, 1 month ago) |
  |
|
     |
 |
Daniel
Team Member


Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Fri Mar 07, 2003 4:16 pm (22 years, 1 month ago) |
  |
Sorry about that. I've now edited my post. |
________________________________
 |
|
    |
 |
Hertzsprung
WebHelper

Joined: 30 Jul 2002
Posts: 56
Location: UK
|
Posted:
Sat Mar 08, 2003 6:16 pm (22 years, 1 month ago) |
  |
I'm writing more of a DB + SQL abstraction  |
|
|
     |
 |
|
|
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.145209 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |