Jump to content

Filtering a Recordset by another recordset


anshugiri

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.