Welcome to Geeklog, Anonymous Wednesday, May 08 2024 @ 09:56 pm EDT

Geeklog Forums

Gracefully Handle SQL Errors


Status: offline

Thesoko

Forum User
Newbie
Registered: 01/14/04
Posts: 1
Is there a way to gracefully handle SQL errors? Specifically, I'd like to have a few columns in my table to be unique, but if someone tries to add a duplicate entry I don't want a big blank nasty page coming, I'd rather have it go back to my data entry page with the values they entered.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Use DB_query(..., 1); and then use DB_error() to see if an error occured.

See system/lib-database.php for details.

bye, Dirk
 Quote

All times are EDT. The time is now 09:56 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content