/    Sign up×
Community /Pin to ProfileBookmark

can u tell any one tell the query

vocabulary table

[code=php]
vid name description
2 vegitable this is vegitable

[/code]

node_revision table

[code=php]
nid vid uid title body teaser
21 21 1 mouse program test test
[/code]

term_data table

[code=php]
tid vid name
5 2 ladies finger
6 2 onion
7 2 beetroot
8 2 ladies finger2
9 2 onion2
10 2 beetroot2
[/code]

term_node table

[code=php]
nid tid
18 4
21 5
21 7
21 8
19 10
20 10
21 10
19 11
[/code]

Hi friends

the above is my table can any one tell the sql query for that ?????

id related all content must display with that query…

any great idea,,,plz i welcome

?

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@Phill_PaffordJul 23.2008 — is it MySQL or MSSQL or Postgres?

What info do you need displayed?
Copy linkTweet thisAlerts:
@PreamJul 23.2008 — I don't get it what are you trying to display?
Copy linkTweet thisAlerts:
@bharanikumarphpauthorJul 23.2008 — U saw the above table,

I need the join query ,using above three table,
Copy linkTweet thisAlerts:
@PreamJul 23.2008 — I always find it easier to use the Where clause to join tables:

WHERE vocabulary.vid = node_revision.vid

AND node_revision. nid = term_node.nid

AND term_node.tid = term_data.tid

or something along those lines
Copy linkTweet thisAlerts:
@Phill_PaffordJul 23.2008 — I see 4 tables

in order to write an optimal query we need to know the relationship of each table. what fields need to be joined and any conditions that might filter your results down to find what you are looking for.

Please explain with more detail.
×

Success!

Help @bharanikumarphp spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...