Jump to content
Larry Ullman's Book Forums

Recommended Posts

Another question, sorry!

 

I`m working on Chapter 6, and I am new to MySQL, so please bear with me.

 

I thought I had got the hang of the parent_id concept but after I had copied and pasted the script, I am even more confused.

 

I thought that if, say, users were replying to the fourth message on the database, then the parent_id for any replies to that particular message would be 4 - i.e. the parent_id stores the message_id to which the new message is a reply.

 

The script that I downlaoded doesn`t follow this. Have I picked this up wrong? Sorry if this seem like a dumb question.

 

Many thanks,

 

Arny

Link to comment
Share on other sites

Arny,

Hi. This is my first attempt at answering a question so please take what I'm about to offer with a huge ladle of salt.

 

As far as I understood it the parent_id is the id of the original message not the latest message. The idea being that it's a way to track the 'list' of messages that make up a single post. See the first column on page 168 (Creating the database).

 

As an aside, I notice that below you say that you cut and paste the code. From my very recent experience of working through the book i had the time to type the code from scratch. I know it sounds long winded but I found it a fantastic way to start remembering and becoming more familiar with the syntax.

 

Hope this helps.

Cheers

Paul

Link to comment
Share on other sites

 Share

×
×
  • Create New...