barney0o0 Posted March 12, 2006 Share Posted March 12, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/4751-show-detail/ Share on other sites More sharing options...
Barand Posted March 12, 2006 Share Posted March 12, 2006 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'"; Quote Link to comment https://forums.phpfreaks.com/topic/4751-show-detail/#findComment-16673 Share on other sites More sharing options...
barney0o0 Posted March 12, 2006 Author Share Posted March 12, 2006 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! Quote Link to comment https://forums.phpfreaks.com/topic/4751-show-detail/#findComment-16676 Share on other sites More sharing options...
Barand Posted March 13, 2006 Share Posted March 13, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/4751-show-detail/#findComment-17127 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.