Jump to content

Archived

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

barney0o0

Show detail

Recommended Posts

Hi folks, i hope someone could help me with this one.

For the first time im trying to use relational databases. The code below works fine in pulling down all the relevant infomation;


[code]$query_Recordset1 = "SELECT * FROM props, gallery_photos WHERE gallery_photos.photo_category = props.propID";

[/code]

The information is a brief overview. I have a 'more info' button that i would like to pass to another page. Before ive used something like

[code]ebro fincas properties_detail.php?ID=<?php echo $row_Recordset1['propID']; ?>

[/code]

However, how do i change the initial recordset (that i will copy and paste into the detail page) to accomodate this new filter of a passed variable....


many thanks in advance

Share this post


Link to post
Share on other sites
I would have thought that you would need to pass the ID of a specific item instead of the propID (which is the category id according to your first query).

In your detail page

$id = $_GET['ID'];

$query = "SELECT * FROM gallery_photos WHERE id = '$id'";

Share this post


Link to post
Share on other sites
Wouldnt this just pull info about the photo table?

....the main content is in the props table. What ive done is to form a record set that selects all info from the props table and link it to the image info with the same ID.

This works fine at the moment (ive pulled down all the records with the correct image)

On the 'more info' button i need to determine which ID the record is from the recordset and pass this onto the detail page

sorry, im just typing this to get it straight in my own mind, by no means are im asking you to suck eggs!

Share this post


Link to post
Share on other sites
Sorry, but all we know about your database is what you have in this query

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]SELECT * FROM props, gallery_photos WHERE gallery_photos.photo_category = props.propID [/quote]

which tells us you have tables "props" and "gallery_photos" and a photo_category column joined to props.propID which makes it seem that the props table is category data.

Share this post


Link to post
Share on other sites

×

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.