943,678 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Unsolved
  • Views: 441
  • MySQL RSS
Mar 31st, 2009
0

Verifying Record before submitting to db

Expand Post »
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...
MySQL Syntax (Toggle Plain Text)
  1. SELECT * FROM orgcode WHERE orgcode = '" . $orgcode . "'

any coaching would be great!
Ted
Reputation Points: 10
Solved Threads: 0
Light Poster
changeco is offline Offline
38 posts
since Dec 2008
Mar 31st, 2009
0

Re: Verifying Record before submitting to db

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.
Reputation Points: 44
Solved Threads: 19
Junior Poster
Stylish is offline Offline
148 posts
since May 2007
Mar 31st, 2009
0

Re: Verifying Record before submitting to db

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...
Reputation Points: 10
Solved Threads: 0
Light Poster
changeco is offline Offline
38 posts
since Dec 2008
Mar 31st, 2009
0

Re: Verifying Record before submitting to db

Quote ...
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.
Moderator
Featured Poster
Reputation Points: 524
Solved Threads: 356
Purple hazed!
nav33n is offline Offline
3,878 posts
since Nov 2007
Mar 31st, 2009
0

Re: Verifying Record before submitting to db

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...
Reputation Points: 10
Solved Threads: 0
Light Poster
changeco is offline Offline
38 posts
since Dec 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: Results from 2 tables
Next Thread in MySQL Forum Timeline: I Need MySql Statement for this





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC