Results 1 to 5 of 5

Thread: Help wanted to synchronize two table

  1. #1
    Join Date
    Jul 2005
    Location
    Karachi - Pakistan
    Posts
    12

    Default Help wanted to synchronize two table

    Hi,
    I want to synchronize passwords of idx_link_temp with idx_link tables so that the current passwords in idx_link_temp should be replaced with the passwords in idx_link table. Being a Windows and MS SQL user, i could not format a correct query to run for this job.
    Can someone please help me?

    thanks in advance.

  2. #2
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    Quote Originally Posted by scriptinn.com
    Being a Windows and MS SQL user, i could not format a correct query to run for this job.
    SQL is SQL and while there are some differences between the various SQL's, I doubt there are any differences at the level you would be working at. Read a record, find that record in the other table and update the record in the other table.


    Quote Originally Posted by scriptinn.com
    I want to synchronize passwords of idx_link_temp with idx_link tables so that the current passwords in idx_link_temp should be replaced with the passwords in idx_link table
    For the life of me I cannot imagine why you would want to "synchronize passwords of idx_link_temp with idx_link tables.

    The idx_link_temp table is used to store the record information created during the ADD link process. When the admin validates the added listing, the information is transferred from the record in idx_link_temp table to a new record in the idx_link table and the record in the idx_link_temp table is deleted.

    The idx_link_temp table should always be empty unless a new listing is waiting to be approved.

    Well, that is the way it worked in v3.x.



    .
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  3. #3
    Join Date
    Jul 2005
    Location
    Karachi - Pakistan
    Posts
    12

    Default

    SQL is SQL and while there are some differences between the various SQL's, I doubt there are any differences at the level you would be working at. Read a record, find that record in the other table and update the record in the other table.
    I was meant to say Microsoft SQL Server, which allows us to execute various sub-queries in a single run, however MySQL does not support this, as of my knowledge.

    So, if it was Microsoft SQL Server, i could have execute this query...
    Code:
    UPDATE idx_link, idx_link_temp SET idx_link_temp.password = idx_link.password where idx_link.link_id = idx_link_temp.link_id
    For the life of me I cannot imagine why you would want to "synchronize passwords of idx_link_temp with idx_link tables.
    You're right that it does not make a sense, but i've done some modifications to run my directory in my personal ways due to which i have different passwords in both tables

    Do you have a solution?

  4. #4
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    Quote Originally Posted by scriptinn.com
    You're right that it does not make a sense, but i've done some modifications to run my directory in my personal ways due to which i have different passwords in both tables
    No problem. the temp table is designed to be transitory. Among other things, INDEXU will try to delete the record when you validate it and if you modify the record (and require permission is set), the record in the temp table will be overwritten.

    as for your solution, your above UPDATE command will work properly in mySQL.



    .
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  5. #5
    Join Date
    Apr 2003
    Location
    NY
    Posts
    331

    Default

    i am not realy sure where you are going with this, but here a link i use to reference some simple mysql statements.


    http://www.w3schools.com/sql/sql_update.asp

Similar Threads

  1. Table colours
    By Kamran in forum v5.x
    Replies: 8
    Last Post: 03-18-2004, 03:17 PM
  2. Some planned mods, feedback wanted.
    By yorweb in forum v3.2
    Replies: 1
    Last Post: 03-04-2004, 03:32 AM
  3. idx_message table?
    By esm in forum v5.x
    Replies: 1
    Last Post: 06-11-2003, 08:00 PM
  4. Yes/No in the table
    By esm in forum Website development, hosting and promotion
    Replies: 1
    Last Post: 05-13-2003, 10:56 PM
  5. Moderator's Wanted & Benefits Offered
    By Hart_House in forum Announcements
    Replies: 0
    Last Post: 10-21-2002, 11:45 AM

Posting Permissions

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