I know it possible to update rows in loop. But how about outside the loop?
Normally i update in loop like this:
PHP Code:
$query = "SELECT id, title FROM table1 ORDER BY id ASC";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$id = $row['id'];
$title = $row['title'];
$sql_update = "UPDATE table SET title = '$title' WHERE id=$id";
mysql_query($sql_update) or die(mysql_error());
}
This works just fine. Outside loop:
PHP Code:
$query = "SELECT id, title FROM table ORDER BY id ASC";
$result = mysql_query($query) or die(mysql_error());
$all_sql_update= "";
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$id = $row['id'];
$title = $row['title'];
$sql_update = "UPDATE table SET title = '$title' WHERE id=$id";
$all_sql_update= "$all_sql_update $sql_update";
}
mysql_query($all_sql_update) or die(mysql_error());
This one wont work!

I tried put after each update end with a comma (like insert), not working also.
Is this possible to make update outside loop?
Actually i need this to update other DB on other hosting. If i put the Update Function to update DB on other hosting in loop it wil works, but took long times to update each of it.
Connnect -> look for DB -> update row -> disconnect
for every rows. The database is not big, but if too much rows to update it will take long time or time out.
I did for Insert, well that easy.
Anyone done this before??