Jump to content

Recommended Posts

Hi,

 

I am calling photos from my database, which is no problem....

the code for which is below:

 

<div id="hotelphotos">

<?php

$hotelident = $_GET["id"];

$con = mysql_connect("dbdetails","dbdetails","db details");

if (!$con)

{

die('Could not connect: ' . mysql_error());

}

mysql_select_db("db details", $con);

$result = mysql_query("SELECT * FROM signuphotel

WHERE id = '$hotelident'

");

while($row = mysql_fetch_array($result))

{

Echo "<tr><td align='center'><img src=http://www.mywebsite.com/images/".$row['photo2'] ." alt='photo2'  border='1' height='160' width='171'></td><tr>";

 

}

mysql_close($con);

?>

</div>

 

 

This is working fine!

 

Now, im attempting to introduce a light box effect in to the page.

 

I've added the lightbox.js and the mootools.js scrtips and putt the path to the head.

 

The code i've used for the photos has now changed to the following:

The result is nothing, just a blank screen....clearly i am goin majoryly wrong somewhere, however could anyone point me in the right direction in gettin from the code above to havin the lightbox ipmlemented in conjunction with the database fed photos.

 

<div id="hotelphotos">

<?php

$hotelident = $_GET["id"];

$con = mysql_connect("dbdetails","dbdetails","dbdetails");

if (!$con)

{

die('Could not connect: ' . mysql_error());

}

mysql_select_db("db details", $con);

$result = mysql_query("SELECT * FROM signuphotel

WHERE id = '$hotelident'

");

while($row = mysql_fetch_array($result))

{

Echo "<tr><td align='center'><a href=".$row['photo1'] ." rel="lightbox[mando]" id="image1" title="image 1">"<img src=http://www.mywebsite/images/".$row['photo1'] ." alt='photo1'  border='1' height='160' width='171' /></a></td><tr>";

echo "<tr><td>      </td></tr>";

 

 

}

mysql_close($con);

?>

 

<script type="text/javascript">

window.addEvent('domready',function(){

Lightbox.init({descriptions: '.lightboxDesc', showControls: true});

});

</script>

 

 

</div>

 

 

 

 

 

 

 

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

Echo "<tr><td align='center'><a href=".$row['photo1'] ." rel=\"lightbox[mando]\" id=\"image1\" title=\"image 1\"><img src=http://www.mywebsite/images/".$row['photo1'] ." alt='photo1'  border='1' height='160' width='171' /></a></td><tr>";

Link to comment
https://forums.phpfreaks.com/topic/172708-lightbox-problem/#findComment-910345
Share on other sites

Echo "<tr><td align='center'><a href=\"http://www.mywebsite/images/".$row['photo1'] ."\" rel=\"lightbox[mando]\" id=\"image1\" title=\"image 1\"><img src=\"http://www.mywebsite/images/".$row['photo1'] ."\" alt='photo1'  border='1' height='160' width='171' /></a></td><tr>";

Link to comment
https://forums.phpfreaks.com/topic/172708-lightbox-problem/#findComment-910368
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.