Jump to content

dopes242

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dopes242's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Also I need to make sure that both work on the same records, in perfect world in the time it takes to carry out both actions no users will edit data. Example, the query will only work on the records that have a email value set, if the insert into runs past a record and a user updates a record to include a email address before the update has ran there will be an issue, chances are small but I rather not run into that problem if I dont have to, Should I: Use a transaction? Find someway of locking that table?(no clue there)
  2. Kicken, im going to be moving about 4 to 5 fields with varchar(5-20) field lengths, Because the loop was going to be running three queries I was going to add a 'LIMIT 1000' the original Select from Table A. Do you think the INSERT INTO is efficient enough to double that limit or remove it? (My scripts are only allowed to run for 5 minutes)
  3. But looking at my next page of code I will have to use a similar loop that will 1. add different data to a queue table 2. update table A to say that it has been queue. (1 look through user profiles who havent been sent a welcome message (welcome_message=null) 2. add user id to to que with welcome message id 3 update user profile to say welcome message has been queue)
  4. That is actually a really good question that is making me wonder now. Background: Table A is a user profile (20+ columns) Table B is table that holds their email addresses and values on if they can be spammed or not, I guess in the beginning I was looking at table B being a separate feature so I made a new table but I guess I could just add Table B's important fields to table A. I guess technically there is no need to copy the information over, thank you Pikachu2000, as easy as that was you ma have just made my work and the servers work a lot easier.
  5. Need some feedback on this loop Tables: Table A Table B Loop Select all from A based on criteria a. Insert into table B using row data from table A b. Update record in table A to say that it has gone through loop to prevent future loop Thats three MySQL queries running over and over at the same time, how bad is that for performance, is there another way? Maybe instead of running b each time build an array with the record ids from Table A and after the loop runs to insert into Table B run another query with the IN command to loop through all of the IDs in the array and update?
  6. I have an audit trail that record users ids and a copy of the sql string for any updates they make to my application. This is very easy for me to follow to find exactly where changes happened but do end users it is a bit of a challenge. Has anyone seen or made a script that can either compare two sql strings to see what fields have different values or a script that takes an SQL string and outputs its field names and values to an array that I can use for comparisons? Example being the look at a update made by user X, the database pulls the sql for that change then looks for the previous change up any user before (update sql should have a value for all fields) then compares to see what user X changed. If not im thinking of case statement to divide sql request between inserts and update then writing a script to split the strings based on where the commas were. Any thoughts?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.