sager29 Posted November 4, 2007 Share Posted November 4, 2007 Say I want to create a staff directory database with two tables. One that has their addresses and one table with there likes and dislikes. I'ld need some sort of Member_ID column in each of my tables. Is there a way to INSERT from a html form into two tables. Any suggestions would be appreciated. Quote Link to comment Share on other sites More sharing options...
simcoweb Posted November 4, 2007 Share Posted November 4, 2007 Actually you don't need to create two tables. If it's a staff directory just put all their info into one. Quote Link to comment Share on other sites More sharing options...
sager29 Posted November 4, 2007 Author Share Posted November 4, 2007 Well actually Im thinking one table might passwords and I thought maybe i'd want to keep the information seperate Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted November 4, 2007 Share Posted November 4, 2007 One the Form POSTed data is extracted, there is no problem with inserting the information into 2 different tables, or 3, or 4 for that matter. But I agree that for what you are trying to do, more than likely one table should suffice. PhREEEk Quote Link to comment Share on other sites More sharing options...
khalidorama Posted November 4, 2007 Share Posted November 4, 2007 HI, It is better if you use two tables. cus any empployees has only one address and when it changes you can update it. however,each employee has different and several likes and dislikes ..hence , it is better to save those records in a separate table. You have to make primary key in first table (for example, emp_id) and forign key in the second table which stores employee ids. First Table: Emp_id first_name last_name address gender etc Second Table: ref_Emp_id likes/dislikes //this has to be of boolean data type content //this field will save what he/she likes or dislikes etc Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.