1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Upating Thousands of Records

Discussion in 'Databases' started by neilfurry, Dec 25, 2017.

  1. #1
    hi mate,

    is there a best way to update a thousand of records in one click?

    right now the way i do it makes the server run away error, due to the loop i used

    if you can provide an example, it would be great.

    what i want is if i click on update button, it will update each row one by one, so there should also be a progress bar, but that i can do myself,.

    how can i utilize loop such as foreach,.. for,.. to do thousand of updating...

    Any help is highly appreciated.
    SEMrush
    Cheers!
     
    neilfurry, Dec 25, 2017 IP
    SEMrush
  2. Benanamen

    Benanamen Greenhorn

    Messages:
    22
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    5
    #2
    How about skipping the code gymnastics and just run the proper querys on the database?
     
    Benanamen, Dec 25, 2017 IP
  3. neilfurry

    neilfurry Member

    Messages:
    48
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #3
    what do you mean, can you give an example?

    i need to be able to, lets say update one record at a time using foreach or any loop that will not cause mysql server lag, due to heavy load of update loops

    Thank you
     
    neilfurry, Dec 25, 2017 IP
  4. Benanamen

    Benanamen Greenhorn

    Messages:
    22
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    5
    #4
    Your head is in the wrong place. Forget about code. Mysql does not require code to run queries. You can run them from the command line or use free GUI's like Phpmyadmin. There is no need for code at all.
     
    Benanamen, Dec 25, 2017 IP