multiple update in of rows in mysql using php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mwika napster
    New Member
    • Mar 2012
    • 1

    #1

    multiple update in of rows in mysql using php

    Hi!
    i need to select multiple rows, edit them and update the specific row in MySQL using PHP.please help me.
  • helimeef
    New Member
    • Sep 2007
    • 77

    #2
    From w3schools:
    Code:
    $result = mysql_query("[INDENT]UPDATE table_name[/INDENT][INDENT]SET column1=value, column2=value2,...[/INDENT][INDENT]WHERE some_column=some_value[/INDENT]
    ");
    I hope this answers your question -- it was quite hard to understand what you were asking.
    Last edited by helimeef; Mar 26 '12, 01:54 PM. Reason: Linked to w3schools source.

    Comment

    • Bharat383
      New Member
      • Aug 2011
      • 93

      #3
      first make one checkbox to select many rows then, get those all rows primary value(something like "id") then count the selected checkboxes and put them into the loop to inserting data or updation data.

      Comment

      • johny10151981
        Top Contributor
        • Jan 2010
        • 1059

        #4
        you can do as bharat suggested

        or you have another trick that you can do

        keeping an array :

        say row 1, row 2, row 3;

        create an array of 3 object. if user make any chnage in row 1 then set high to array 1. if 2 then array 2.

        in the server php would read the least of updated row and only do the update execution only the changed row.

        you can do far more trick with change action and array. all you need to do is build the idea ;)

        Comment

        Working...