How to write a loop function?

There are 3 loop functions:
-do while
-while
-for

There are different way of writing a loop function, but ours way of writing is like below:

Example 1: do while

do{
  //perform this
}while();
while(){
  //perform this
}
for(){
  //perform this
}

Discourage way:

do
{
//perform this
}while();

Note that the difference between is that we don't go to new line, we compact codes. So, its easier to read, and better performance in the sense of less line of codes.

Comments

qqq

Hundreds of links of london jewellery in stock,Top quality links of london sale collection,including necklaces,bracelets,earrings
links of london
links london

Updating multiple fields

Updating multiple fields based on query results can be quite expensive if the same query has to be executed multiple times. Imagine the following table adult web hosting:

summary(X,A,B,C,D) and a query which returns: (X,E,F) and you want to update the summary table fields C and D with the values of E and F:

Summary: (1,2,3,0,0),(10,12,13,0,0) and query result: (1,4,5),(10,14,15) should result in the updated summary table: (1,2,3,4,5,6),(10,11,12,13,14,15) web templates

BAD SOLUTION (same query is evaluated twice!):

UPDATE summary SET C=(SELECT E FROM (query) q WHERE summary.X=q.X), D=(SELECT F FROM (query) q WHERE summary.X=q.X)

GOOD SOLUTION (query is only evaluated once):

UPDATE summary AS t, (query) AS q SET t.C=q.E, t.D=q.F WHERE t.X=q.X