depends on the lightbox you use, with sllimbox:
slimbox
you use a link, with rel attribute:
<a href="images/image-1.jpg" rel="lightbox" title="my caption">image #1</a>
you could create a recordset to return the thumbnail and large image file name, and use those in the link code for example:
<a href="images/<?php echo $row_recordsetName['largeImage']; ?>" rel="lightbox" title="my caption"><img src="thumbs/<?php echo $row_recordsetName['thumbImage']; ?>" /></a>