8 Years
Discussion Span
Last Post by restyle

It's a little bit confuzing the code

<li><a href="<?php $check=$id; ?>"><p id='opmaak'><?php echo $title; echo $check; ?></a></p></a></li><?php

If I will undersand what this link really has to do, maybe I'll help you.


That line should display all the photo album titles in a list and when you click on it link it should connect to the correct images.

My problem lies in the <a href="<?php $check=$id; ?>" bit i don't know how to link it to the correct database part


Still bit confuzed about how your application looks. If I would now for clear I would solution you. However.. by guessing:
I don't know where $checkid variable comes from but I guess it's an ID from images table and you want it to match the ID from the images INFO table and make a link to that image right?
If I understood well... there are some posibilities: let's try this:

<li><a href="<?php echo $IMAGE_URL; ?>"><p id='opmaak'><?php echo $title; echo $check; ?></a></p></a></li>
<?php } ?>
//you must query IMAGE_URL from the database

Maybe I gave you a point...


$check is just a made up value to test, the main problem is that all images are in the same folder and i cant really change that because that's how the CMS works, but all the images are linked to the cat_id and the cat_id represents the album.

the problem lies in

<li><a [B]href="<?php $check=$id; ?>[/B]"><p id='opmaak'><?php echo $title; echo $check; ?></a></p></a></li><?php
$sql= "SELECT cat_id, thumbnail, caption FROM gallery_assets WHERE [B]cat_id=$check[/B] ORDER BY order_num ASC";

the bold value should make it into the SQL qry, but what happens now is that the $id only takes the last value (due to the while loop)
what i need is that value to be in there for every link it makes.

album names
Summer 1
Forrest 2
Flowers 3

so when i click on 1 it should take it to the SQL qry and check it with cat_id if they match the images behind that id will load into the picturebox, but currently the id doesn't stick to the href="" when i click on it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.