Welcome to Geeklog, Anonymous Thursday, November 28 2024 @ 11:47 pm EST

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 EST. The time is now 11:47 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