Welcome Guest, Not a member yet? Register   Sign In
Writing to one database field from comparison of two separate database fields
#1

[eluser]mingquel[/eluser]
So, I've been working on a glossary page that works in conjunction with two separate databases. Our final problem is this:

Database one contains the following fields - id, Terms, Definitions, cat_id (category ids), Category (letters relating to the terms) and status.

Database two contains - id (which corresponds to the cat_ids in the first database), gl_categories (which correspond to the Category field of the first table) and status.

Here is what's suppose to happen; When a user chooses a letter from the dropdown menu, enters a Term and Definition and selects whether or not the status should be active or inactive, they submit the entry to be created and all of this is to be written to the first database.

The problem is, how would I go about comparing the Category field from the first database and the gl_categories field from the second database, and have it return the proper id from the second database (there are twenty-six of them, one for each letter of the alphabet) to be written into the cat_id field of the first database? I've gotten it to write the Category, Term, Definition and status into the database but can't get the cat_id to write anything other than zero. Does my question make sense? Any help would be greatly appreciated.




Theme © iAndrew 2016 - Forum software by © MyBB