Nick,

> Well I /hadn't/ tested as I wasn't sure that my DB design wasn't flawed,
> I was expecting someone to say 'well if you want to do that you need to
> design like this..' No matter.

Again: if you use the native-MySQL/command line, or an administration/management 
package, you will be able to
quickly create prototype tables and bounce queries off them. The best way to 'test' a 
design/approach, is to
test it out!

> > Recommendation: treat the (possible) addition to the author tbl as one task, and 
>the (required in both
cases)
> > addition to the content tbl as a separate task.
>
> I'm not sure I understand you recommendation, would kindly explain a
> little more?

> > > > 2 tables
> > > > content ---- TipId | AuthId | title | keywords | desc | section | text
> > > > author  ---- AuthId | name | email | bio
> > > >
> > > > My question is: If I enter a 'tip' and put myself as the author, when
> > > > /I/ come to write another tip how do I make my query avoid  putting
> > > > another entry in author? I'll be using PHP for the front end.

This explanation describes the 'problem' as one task. The recommendation is that it be 
split into two - in so
doing, the two 'problems' become quite simple and much more straight-forward.

So looking at your question from a 'design' (cf a coding) point of view:
There are two tables.
There is a one-to-many relationship between author and content, ie one author may 
contribute multiple tips, but
it is assumed that one tip is credited to only one author.
When a new tip is to be entered into the database, there are two tasks: one related to 
author, the other related
to the tip.
The tip cannot be entered into content until the AuthId is known, so that puts it 
second in line.

Starting with the author: either the author already exists in the table 
(SELECT=successful), in which case
his/her AuthId needs to be ascertained and fed to 'part two'; or the author's details 
are not 'on file' and
therefore must be INSERTed (and the AuthId noted...'part two').

Once the AuthId is known, 'part two' can take place, and the tip written to the 
content tbl.

Thus two tasks: (1) deal with the author 'issue', and (2) save the tip.

Regards,
=dn


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to