bad texture mapping on sides of a cylinder
While using the basic generated texture co-ordinates can be easy and helpful in some cases, you want to use UV-Unwrapping to get full control of how your texture looks. BlenderCookie has an introduction tutorial that explains more.

The basics are -

First mark the seams, this is where the edges are "cut" to get the model laying flat on a 2d texture image. CtrlE->Mark Seams with mark the selected edges.



Then you unwrap - Select all with A, then U->Unwrap



Now when you set the mapping to UV for the texture you will get the same bricks texture on the top as well as the sides.



For more control you can also assign different materials to the top and sides.