1
Catzwolf
Database Query Question
  • 2004/10/6 10:43

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


I was going to ask this question over at the Dev.xoops site, I signed up but I didn't really want to sign up for for a new project. oh well. =)

Ok now to my problem, I have two tables and I wish to take information from both but everytime I do this I am getting errors. =/

Table1
cid
pid
title

table2
art_id
art_cid

If would like to do a query where I would count table2 art_cid total where art_cid = cid.

so I am taking information from table1 and taking the information from table2 as one array.

Hope this is clear enough for everyone to understand.

2
Mithrandir
Re: Database Query Question

Quote:

wfsection wrote:
Table1
cid
pid
title

table2
art_id
art_cid

If would like to do a query where I would count table2 art_cid total where art_cid = cid.

SELECT t1.cid, t1.pid, t1.title, COUNT(t2.art_id) as artcount FROM Table1 t1, table2 t2 WHERE t1.cid = t2.art_cid GROUP BY t1.cid

Which errors are you getting and what are you trying?

Login

Who's Online

266 user(s) are online (185 user(s) are browsing Support Forums)


Members: 0


Guests: 266


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits