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

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'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...

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.

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...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.