How to rotate image fetching dynamically from database?

Hi all,
I want to display an image with 180 degrees (rotate) an image in my web page, that to getting the image URL from database dynamically, based on select box selection.

But i used the link like this:::
getting $id from select box.

$imgFile=imagerotate('images/'.$id.'.gif', 180, 0);

then it will shows an error like this:
Warning: imagerotate() expects parameter 1 to be resource, string given.

how to use this function? can any one help regarding this…

Note::
in same page i want to display another select box and another image as well without any disturbance in the other images.

I would first try changing the ’ to "


 $imgFile=imagerotate("images/".$id.".gif", 180, 0);
//This may work and be better:
 $imgFile=imagerotate("images/$id.gif", 180, 0);  

Then I would try conenating? the name outside the function:


$image =  "images/$id.gif"; 
$imgFile=imagerotate('$image, 180, 0);

$image = “images/$id.gif”;

$imgFile=imagerotate($image, 180, 0);

I used like that.
but the same error it is showing on this line.::warning: imagerotate() expects parameter 1 to be resource, string given
$imgFile=imagerotate($image, 180, 0);

Check the manual page for examples, you need to create an image resource first. :wink:


<?php
$image = imagecreatefromgif('path/to/image.gif');
$rotated = imagerotate($image, 180, 0);