954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Verifying Record before submitting to db

I have a registration page that needs one final thing and I'm a little stumped...

In one table I have email, pass, gender, dob and the other I have company...

In the registration page, I want to check that the company exists before I submit the form... Since I'm using tools for this and NOT hand coding things, I'm a little lost... Ideally using an AJAX script to check on the orgcode input field would rock...

Here's what I have...

SELECT * from orgcode WHERE orgcode = '" . $orgcode . "'


any coaching would be great!
Ted

changeco
Light Poster
38 posts since Dec 2008
Reputation Points: 10
Solved Threads: 0
 

Does Table1 (email, pass, gender, dob) have a foreign key constraint on CompanyTable? If so, let the database handle the foreign key validation and have the web application check for errors.

Insert failures due to foreign key problems (ie: non-existant CompanyId) will have a specific error number stating a foreign key problem.

Stylish
Junior Poster
149 posts since May 2007
Reputation Points: 44
Solved Threads: 19
 

I'm using tools because I have NO idea where to start on something like this on my own...

I have no idea what a foreign key is, nor how to make one... I assume its a connector for the tables, the short answer is no, I don't have a foreign key constraint... Sorry for my n00b stupidity...

changeco
Light Poster
38 posts since Dec 2008
Reputation Points: 10
Solved Threads: 0
 
Since I'm using tools for this and NOT hand coding things, I'm a little lost... Ideally using an AJAX script to check on the orgcode input field would rock...


I don't know what exactly you mean by tools. But check this example.
In the example, there is a dropdown list, but you have a text field. You can use onblur event (or onkeyup event) to call the ajax function to check if the value entered in the text field is already there in the database.

nav33n
Purple hazed!
Moderator
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
 

by tools I mean the company I work for uses webassist dreamweaver tools... so you can quickly build dynamic stuff with minimal development knowledge, which is EXACTLY where I am... I am learning but some of the required elements are WAY above my head..

Thanks nav33n for your help...

changeco
Light Poster
38 posts since Dec 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You