SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    canada
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can i update a row in one table and insert row in another table?

    I'm implementing a voting system in my photo log cms.
    i wnat to update the entry_rank by pulling the value increaing by one and updating. I have this working already.

    I've read that you cannot insert rows in multiple talbe in one query but can i update the one and insert a row to the vote table (i want to record the voters ip, date etc)

  2. #2
    SitePoint Enthusiast mind21_98's Avatar
    Join Date
    Apr 2003
    Location
    Inside, away from the light.
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by alt-f4
    I've read that you cannot insert rows in multiple talbe in one query but can i update the one and insert a row to the vote table (i want to record the voters ip, date etc)
    You'll need to submit two separate queries to get that part working. MySQL doesn't allow combining of queries at this time.

  3. #3
    SitePoint Addict CeleronXL's Avatar
    Join Date
    Dec 2002
    Location
    United States of America
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But combining queries isn't really all that necessary anyway.. Just run two. o_O

  4. #4
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    canada
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i did it with 2 separate queries. works fine to do it that way, i just thought if it could be done it on it might be more efficient

    thank you for the speedy replies
    scott


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
  •