SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Populating a column in one table with a column in another table

    Ok, so here is my latest challenge. I store outgoing emails in a table called notifications. In that table is a column called recipient, which is an email address. I recently added a new column to the notifications table called userID. Since I have the receiver's email address, I need to somehow get the userID from the user's table, and add it to the userID of the notifications table. Can someone suggest a way this can be accomplished?

    Thanks!
    Convert your dollars into silver coins. www.convert2silver.com

  2. #2
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I think I found something on the web that will work. Does this look appropriate?

    UPDATE notifications, users
    SET notifications.userID = users.userID
    WHERE notifications.userID = 0 and notifications.recipient = users.email;
    Convert your dollars into silver coins. www.convert2silver.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •