Jump to content

mysql fetch doubles the ammount when insert an hyperlink


Lisa23

Recommended Posts

Hi i have this while fetch query which brings up a images from the database  but know i tried to add a delete link in each image so i add a delete hyperlink inside the query but instead counts the link as if it was a image too. like if i have 5 images it will double to 10 because of the delete hyeprlink why is this happen help please

 

<?php
define('ROOT_DIR', './');
define('PROPER', TRUE);

/**
* include common files
*/
include_once(ROOT_DIR. 'includes/common.inc.php');



?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="css_eurico/lightbox.css" rel="stylesheet" type="text/css" />
<link href="css_eurico/jquery.lightbox-0.5.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="js_eurico/jquery.js"></script>
<script type="text/javascript" src="js_eurico/jquery.lightbox-0.5.min.js"></script>



<script type="text/javascript">

$(function() {

$('#gallery a').lightBox();

});

</script>


</head>

<body>

<?php
$album_id = $_GET['albums'];


$photo = mysql_query("SELECT * FROM photos WHERE album_id='$album_id'");


echo '<div id="menu">';
while ($row = mysql_fetch_assoc($photo))

{

     
     echo '<div id="gallery">';    
        echo'<div class="Image">';
    
        echo '<a href=photos/thumbs/'. $row['photo_proper'] . '  "><img class="picture" src="photos/' . $row['photo_proper'] . ' " width="100"  height="100 " /></a>';
        echo '<h4 class="brand">' . $row['photo_name'] . '</h4>';
          
             

        echo '</div>';
            
             echo '<a href="index.php">alo</a>';
    
}

?>

</div>
  </div>


</body>
</html>

Link to comment
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.