Click here to register.
      
Bazaar


     Discuss > Web Design, Templates, and Themes

SQLForm with unique field(s)

User zylo
Date 2/8/2008 12:11 pm
Views 540
Rating -4    Rate [
|
]
Previous · Next
User Message
zylo

I am creating an sqlform for a newsletter I am sending out,
where users can signup with:

Name and Email

I want the sqlform to check the email field in the  database table , to see
that is does not already exist.

I tried to manually make the database field Unique (from a mysql perspective), like this:
 alter table mailinglist change email email char(255) unique;

It works fine from a mysql view, but when i enter none-unique values,
I get a server error.
THe best would perhaps be for the SQLForm to check on the field attributes in the database table and if its unique, check it against the submitted data before inserting.

 
Is there any way to do what I am trying to do?
Or should I tweak SQLform to check field attributes before inserts?

 

--- (Edited on 2/8/2008 12:11 pm [GMT-0600] by zylo) ---

--- (Edited on 2/8/2008 12:34 pm [GMT-0600] by zylo) ---



Back to Top
Rate [
|
]
 
 

Recent Discussions Color Key

Design:

Development:

Et Cetera:

Install/Upgrade:  

Smoketest:

Template Group:


Re: Site paid for by advertizing by Klaus - Fri @ 02:27am

Smoke Test for WebGUI (Stable) (2008-11-21) by botaction - Fri @ 12:37am

Re: Site paid for by advertizing by pwrightson - Thu @ 10:59am

Re: Site paid for by advertizing by JT - Thu @ 08:58am

Re: Regelmäßiger Termin für Usertreffen in der Rhein-Neckar-Region by Klaus - Thu @ 06:11am

Smoke Test for WebGUI (Stable) (2008-11-20) by botaction - Thu @ 12:00am

Smoke Test for SVN (2008-11-20) by botaction - Thu @ 12:00am

Re: Improving page layouts by fdillon - Wed @ 08:38pm

Re: Improving page layouts by knowmad - Wed @ 08:25pm

Re: Site paid for by advertizing by knowmad - Wed @ 08:07pm

Re: SSL Configuration? by knowmad - Wed @ 07:51pm

Re: The Death of the Collaboration System by preaction - Wed @ 07:39pm