anshugiri Posted July 7, 2007 Share Posted July 7, 2007 hi, i am trying to filter a recordset using another recordset i tried $query_Recordset1 = "SELECT * FROM wayra_gallery WHERE img_albumname = $row_rs_albums['gallery_alb_name']"; here rs_albums is another recordset that exists: recordset1 is the one i am trying to create what is the mistake...and how can i correct it thanks Quote Link to comment https://forums.phpfreaks.com/topic/58839-filtering-a-recordset-by-another-recordset/ Share on other sites More sharing options...
Wildbug Posted July 7, 2007 Share Posted July 7, 2007 You haven't really given enough detail to expect a correct solution to your problem. Assuming the $row_rs_albums['gallery_alb_name'] array element contains a valid numeric value, then the only wrong with the query, syntactically, is the use of single quotes around the element key within the double quotes. However, if the img_albumname is a VARCHAR (or similarly string-based), then you should be quoting the value. $query_Recordset1 = "SELECT * FROM wayra_gallery WHERE img_albumname = '$row_rs_albums[gallery_alb_name]'"; // or $query_Recordset1 = "SELECT * FROM wayra_gallery WHERE img_albumname = '{$row_rs_albums['gallery_alb_name']}'"; You should have looked for and posted errors pertaining to this issue if you had any. Quote Link to comment https://forums.phpfreaks.com/topic/58839-filtering-a-recordset-by-another-recordset/#findComment-291985 Share on other sites More sharing options...
anshugiri Posted July 8, 2007 Author Share Posted July 8, 2007 thank you for the solution...that statement does work...however, it only returns the results for the first value. How would i be able to use this for a repeat region? thank you Quote Link to comment https://forums.phpfreaks.com/topic/58839-filtering-a-recordset-by-another-recordset/#findComment-292249 Share on other sites More sharing options...
Wildbug Posted July 8, 2007 Share Posted July 8, 2007 Can you post your code relevant to this issue? Is there actually more than one record in the database? Quote Link to comment https://forums.phpfreaks.com/topic/58839-filtering-a-recordset-by-another-recordset/#findComment-292494 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.