I want to display an image on background (by using CSS repeat) the same way as on Twitter but the problem is that I am retrieving it from a MySQL database and CSS cannot handle
You can do this in two steps.
Create a PHP script that accepts a parameter to identify through a unique ID, which Row has the image to display. This script will extract the image from database and send the codes with appropriate mime-type, so that browser understands. This way, apply a class to the container (or body tag) and display the background like:
.backgroundTile { background-image: url('/path/to/php-image-render-script.php?image_id=1212') !important; background-repeat: repeat; }
Example PHP Script (Source- http://cookbooks.adobe.com/post_Display_an_image_stored_in_a_database_PHP-16637.html ) :