Query your image from the table and pass this into the function argument where you want to do.
Below is sample:
$sql = "SELECT * FROM image_table WHERE image_id = 123 ORDER BY image_id DESC LIMIT 1";
$row = mysql_query($sql);
$image = mysql_fetch_assoc($row);
//pass the image to the function parameter
createThumbnail($image);
Isn't what you want ?