Page 1 of 1

Copying data into another table?

Posted: Thu Oct 19, 2006 1:35 am
by cturner
Can someone please tell me how I can copy one item in one row into another table? I am wanting to do the above when a comment is being added to the second table. I am wanting to copy userid in the users table into the commentpost table. Thanks in advance.

My tables are like this:
Article (Articleid, selectDay, selectMonth, selectYear, article_item)
Users (Userid, username, password, email, ip)
Commentpost (Articleid, userid, comments, date_entered)

Posted: Thu Oct 19, 2006 6:40 am
by feyd
You should have the user id prior to the insertion under most common circumstances. :?

Posted: Thu Oct 19, 2006 5:25 pm
by cturner
feyd wrote:You should have the user id prior to the insertion under most common circumstances. :?
Not in this case. Are you going to show me what I have asked or not?

Is this suppose to be posted in the PHP forum. If so can someone please move it there?

Posted: Thu Oct 19, 2006 5:30 pm
by feyd
Perform a select to pull out the user id then.