Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to set two values equal from different recordset?

New Here ,
Jun 25, 2009 Jun 25, 2009

I have created a posts recordset and a comments recordset

the comments table has a post_id to link the comment to a specific post through setting it equal to the id field in the posts table

so that whenever a post loads the comment whos post_id is equal to the id of the post should load

I know that if one advanced recordset combining the two tables is created I can set the values to be eqal in the where clause but doing so causes an error in the url parameters of the page.

Plz help guys and thanks in advance.

TOPICS
Server side applications
553
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Jun 25, 2009 Jun 25, 2009

Just do this in advanced recordset

SELECT *

FROM posts JOIN comment

ON posts.post_id = comment.post_id

WHERE posts.post_id = colname

Add 1 variable

name: colname

type: numeric

default value: -1

runtime value: $_GET['pid']

so in browser URL it will be post_view.php?pid=1

Translate
Guest
Jun 25, 2009 Jun 25, 2009

Just do this in advanced recordset

SELECT *

FROM posts JOIN comment

ON posts.post_id = comment.post_id

WHERE posts.post_id = colname

Add 1 variable

name: colname

type: numeric

default value: -1

runtime value: $_GET['pid']

so in browser URL it will be post_view.php?pid=1

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 26, 2009 Jun 26, 2009

Well Thanks for the quick reply but dreamweaver shows an error saying that "comments.post_id does not exist in ON clause"

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 26, 2009 Jun 26, 2009

ok it works thanks a lot its just that the row wasn't comments.post_id it was comments.posts_id.

Thanks a lot Dear.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 28, 2009 Jun 28, 2009
LATEST

Welcome I'm so glad that you can solve the problem now.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines