Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making sure Aministrators add complete info...

Status
Not open for further replies.

groovygarden

Programmer
Aug 23, 2001
63
I'm developing for a college so they can keep track of books published by academic staff members. The site is PHP with a mySQL database

On the page where an administrator can add a book to the database there is an option to select the author from all the authors in the database. My problem is, what if that author isn't in the database yet? Should I make the administrator add the new authors details straight away or should I get them to do it after they have entered the details for the book? I have to bear in mind that when they go to add the Author, they may well face the same problem again - for example having to add a new Agent that isn't in the database yet.

Basically I want to make sure that administrators don't add incomplete data to the database (ie: add a book, without adding its author or add an author without adding his/her agent) without causing the poor admin guy or gal a lot of hassle! Can any one think of a clever way to do this?! Thanks a lot
 
Hi mate,

Validate the fields and make sure that the required ones contain information.

As for adding new Authors, this is up to you and we can't tell you the best way to do this.

Hope this helps Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
I ran into the same type of problem but with a backup tape log DB. It tracked when backup tapes left and came back but the problem came up when new tapes were inserted into the cycle.

I did it using ASP but same rules should apply using PHP. I used Javascript first to make them fill in the field. Then when the information was submitted before inserting it I did a query of the actual tapes (which would be your Arthors) if the tape was not in there it redirected to a "add tape page" if the tape was already in the DB it went on as usual.

or you can create a drop down list from the authors from the database and if the name is not on the list have a link on the side saying add new author and open it up to a seperate window. This actually be your best bet because from exprience if you let users "free hand" information you get all kinds of different spellings and misspellings which leads to duplicate records.
AJ
I would lose my head if it wasn't attached. [roll1]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top