Verifying Record before submitting to db

Reply

Join Date: Dec 2008
Posts: 15
Reputation: changeco is an unknown quantity at this point 
Solved Threads: 0
changeco changeco is offline Offline
Newbie Poster

Verifying Record before submitting to db

 
0
  #1
Mar 31st, 2009
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...
  1. SELECT * FROM orgcode WHERE orgcode = '" . $orgcode . "'

any coaching would be great!
Ted
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 146
Reputation: Stylish is an unknown quantity at this point 
Solved Threads: 14
Stylish's Avatar
Stylish Stylish is offline Offline
Junior Poster

Re: Verifying Record before submitting to db

 
0
  #2
Mar 31st, 2009
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.
I NEED AN ADULT!
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 15
Reputation: changeco is an unknown quantity at this point 
Solved Threads: 0
changeco changeco is offline Offline
Newbie Poster

Re: Verifying Record before submitting to db

 
0
  #3
Mar 31st, 2009
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...
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,746
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 331
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: Verifying Record before submitting to db

 
0
  #4
Mar 31st, 2009
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.
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 15
Reputation: changeco is an unknown quantity at this point 
Solved Threads: 0
changeco changeco is offline Offline
Newbie Poster

Re: Verifying Record before submitting to db

 
0
  #5
Mar 31st, 2009
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...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the MySQL Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC