Jump to content

LIGHTBOX


phpwannabe25

Recommended Posts

Hi,

 

Just a question in regards to the lightbox.

 

The site i have draws images relevant to teh users page on to the screen with a SQL statement.

The images are kept in the images directory and the image 'address' is stored in a table.

so i need to connect to the database in order to get teh image echoed on to the screeen.

 

every lightbox example i ahve seen on the web, simply has the images folder and the image is named in the xHTML.  This will not be the case in my situation, the image displyed will be drawn from the sql statement.

 

Will it still be possible to use the lightbox in this case, and if so what is the best way to approach it?

 

Thanks in advance

 

:D

Link to comment
https://forums.phpfreaks.com/topic/172139-lightbox/
Share on other sites

Thanks mathewJ.

 

Im still havin a few problems..

ill be more specific.

 

The one i am using and which works is as follows, with no database, just the image directory next to the other folder...

<a href="images/26.jpg" rel="lightbox[mando]" id="image1" title="image 1"><img src="images/26.jpg" height="100" width="100" border="0" alt="" /></a>
	  <div class="lightboxDesc image1">My description for image 1</div>

 

then the way i am drawin the image to my page is as follows, (before the lightbox effect)

 


<?php
$con = mysql_connect("dbdetails","dbdetails","dbdetaisl");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}


mysql_select_db("dbdetails", $con);


//Retrieves data from MySQL
$data = mysql_query("SELECT logo FROM signuphotel WHERE signuphotel.username = '$username'") ;

//Puts it into an array
while($info = mysql_fetch_array( $data ))
{

//Outputs the image and other data
Echo "<tr><td align='center'><img src=http://www.mysite.com/Website/images/".$info['logo'] ." alt='logo' rel='lightbox[mando]' border='1' height='100' width='100'> <br></td></tr>";


}



Ths is where i am confuse....????

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/172139-lightbox/#findComment-907942
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.