This is my code to show the picture from MySQL.
echo '<table>';
echo '<tr>';
echo '<td><a href="imagedisplay.php"><img src="galleryshow.php?id=' . $row['id'] .'" width="300" height="250" /></td>';
echo '<td><li>Species:'.$row['species'].'</li><li>Age: '.$row['age'].'</li><li>Sex: '.$row['sex'].'</li><li>Date: '.$row['date'].'</li><li>Time: '.$row['time'].'</li><li>Location: '.$row['location'].'</li><li>Comment: '.$row['comment'].'</li></td>';
echo '</tr>';
echo '</table>';
I want display the same picture on imagedisplay.php
.
This is not much of an answer, since it's not much of a question:
You'll need to pass your $row['id'] as a parameter to your imagedisplay.php
. Using GET
it would look something like:
echo '<td><a href="imagedisplay.php?rowid=' . $row['id'] . "><img src="galleryshow.php?id=' . $row['id'] .'" width="300" height="250" /></a></td>';
You'll have to pick that variable up in your imagedisplay.php
code and then use it again like you did here.
You'll need to look at $_GET
and pass it through as a parameter for imagedisplay.php
.
Your url should be something like:
<a href="imagedisplay.php?image=<?=$row['id'];?>">image_code</a>
The main important bit being ?image=<?=$row['id'];?>
Then, on imagedisplay.php
<img src="galleryshow.php?=<?=$_GET['image'];?>"/>
That should get your image.
However, if this image is literally only being shown on the page and nothing else, you could just have a link to the image so it opens up in browser, or use JavaScript to enlarge on click.