&
runs a program in the background, and it's also an "end of command" indicator just like ;
, which is why your command is cut short. You can escape it with \
or put the whole thing in double quotes:
echo http://api.stackoverflow.com/1.0/users/113124/favorites?page=$i\&pagesize=100
echo "http://api.stackoverflow.com/1.0/users/113124/favorites?page=$i&pagesize=100"
Interestingly, pagesize=100
was also being executed as a separate command, but that is actually a valid variable assignment. So it wasn't generating an error message which might have clued you in to what was happening.
The backgrounding means all of the echo statements were executed in parallel. That explains why they ended up being executed in random order since the seven processes will finish in an indeterministic order based on when they get time slices from the kernel.