Page 2 of 2

Posted: Sun Jan 07, 2007 8:58 am
by feyd
Okay. Last time I try this. You skipped the most critical part:
You would then loop over $_POST['foo'] where the keys will be the original room number and the value will be an array of the numberRoom and stateRoom values. Each iteration over foo will require a new UPDATE query.

Posted: Sun Jan 07, 2007 11:17 am
by hrubos
Thank you very much for your try

I have done this
page2.php

Code: Select all

print_r($_POST['foo']);

foreach ($_POST['foo'] as $key => $value) {

  list($new_number_room, $new_state_room) = $value;

  $query = "UPDATE room p SET p.number_room = '$new_number_room',

p.state_room = '$new_state_room' WHERE p.id_numberRoom = $key"; 
mysql_query($query) or die(mysql_error());
}
Did you think that?