#1
  1. chown python:users\ /world
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Texas Tech
    Posts
    95
    Rep Power
    14
    I need to increment the value of 'id' in 5 tables whenever it is incremented in another table.... Is there any way to do this? How?

    ------------------
    Hartmann
  2. #2
  3. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,640
    Rep Power
    4476
    You'd have to do an update for each table.

    ---JH
  4. #3
  5. chown python:users\ /world
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Texas Tech
    Posts
    95
    Rep Power
    14
    How?

    ------------------
    Hartmann
  6. #4
  7. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,640
    Rep Power
    4476
    UPDATE table1 SET id=id+1 where id=X

    or, if you want to update all ids...

    UPDATE table1 SET id=id+1

    Then do the same command for table2-5. You execute the command through a mysql_query(). I'm assuming you can already connect to the database and everything....

    ---John Holmes...

    ------------------
    *************************************************************
    * The manual can probably answer 90% of your questions...
    *
    * PHP Manual. www.php.net/manual
    * MySQL Manual: www.mysql.com/documentation/mysql/bychapter
    *************************************************************
  8. #5
  9. chown python:users\ /world
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Texas Tech
    Posts
    95
    Rep Power
    14
    Works perfectly! Thanks!

    ------------------
    Hartmann

Similar Threads

  1. Replies: 2
    Last Post: January 28th, 2004, 07:07 AM
  2. Inserting from form to multiple tables
    By barth in forum MySQL Help
    Replies: 0
    Last Post: January 25th, 2004, 09:27 AM
  3. Replies: 1
    Last Post: January 19th, 2004, 11:32 PM
  4. Replies: 2
    Last Post: January 18th, 2004, 10:10 PM
  5. selecting distring records across multiple tables
    By kubicon in forum MySQL Help
    Replies: 3
    Last Post: January 9th, 2004, 05:41 PM

IMN logo majestic logo threadwatch logo seochat tools logo