Ok, let me explain…
The website i am making is a web based digital library and will only be used by VERY limited people. I have had a re-think and have decided to have an email field in People table so that an author with the same name can be inserted but with different emails so that we can differentiate between them…
The digital library will contain journals, documents, papers etc that have been written by researchers…
Moving on, the purpose of the 2 tables is, the People will simply hold the Authors personal info, and the PeopleCon will contains authors that have written a specific document. Obviously most of the time, a paper is written by multiple authors. So if we look at the tables now:
People
Pid, Pname, Pemail, Pdateadded, Pdeleted
And…
PeopleCon
PCid, Pid, PCHid, PCorder, PCdateadded, PCdeleted
So “PCHid” is the ID of the paper/document what has been written. the “Pid” will be the ID of the author from the People table. And finally if for example there are 6 authors who have written the same paper the results should look like this in the PeopleCon table:
1, 1, 29, 0, 2010-07-24 17:20:49, 0
1, 2, 29, 1, 2010-07-24 17:20:49, 0
1, 3, 29, 2, 2010-07-24 17:20:49, 0
1, 4, 29, 3, 2010-07-24 17:20:49, 0
1, 5, 29, 4, 2010-07-24 17:20:49, 0
1, 6, 29, 5, 2010-07-24 17:20:49, 0
So you see ‘29’ is the ID of the document which is from a different tabal, i can JOIN this later. As you can see the PCorder will increment i have shown this as 0 to 5.
But can you see what i am trying to do here?
I will add an email field with the author so that we can now distinguish between whether or not an author has exists by their email, i will need to change my first method to this:
public function checkEmailExists(){
$query = "SELECT * FROM People WHERE Pemail = '". mysql_real_escape_string($_POST['Pemail'])."'";
$result = mysql_query($query);
if(mysql_num_rows($result) > 0):
$row = mysql_fetch_array($result);
return true;
else:
return false;
endif;
}
So if you look back at my code and the 3 methods, i need to somehow combine these into one, check to see if an author exists, if so insert that author as a NEW author in People, AND insert them into the PeopleCon. Now this needs to be inside a for loop and needs to be done for every author that is inserted. So there may be a time where 4 authors are inserted and only 2 are new and 2 are not and vice versa…
Does this answer you questions 
And back to the main question, how can i do this 
Thanks again