Link to home
Create AccountLog in
Avatar of IAMSYLAR
IAMSYLAR

asked on

How to have Multiple queries on one page

I want to create a tags page of various keywords which has the name of the link plus the number of results of that query. For example 20+ keywords. (horror, comedy, drama,etc..) I want to show how many results are relative to that keyword. horror (5) comedy (30) drama (4). Now Im wondering if I create a page with 20+ queries at once would that be the proper way of doing it? Wouldn't that be very demanding on the server?

Please tell me  and perhaps show me how to properly accomplish this....thanks

Also please be descriptive in your response. I am a newby php programmer...
Avatar of Lukasz Chmielewski
Lukasz Chmielewski
Flag of Poland image

It would be better to have the values already counted in database. You might just count it in the real time at the moment of adding tag to table. Can you post the tags table structure ?
ASKER CERTIFIED SOLUTION
Avatar of wolfgang_93
wolfgang_93
Flag of Canada image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of IAMSYLAR
IAMSYLAR

ASKER

Right now I already have one table that has a field of keywords related to that row. For example One Entry will be the movie HANG OVER and on that entry has a field called "keywords" with the entries 'comedy, guy flick, vegas'. The next entry will be DUMB & DUMBER with keywords comedy, friendship, drama.

I want to have a link for COMEDY (2), count both movies and display results once clicked. However I will have 20+ keywords. So would I have to create a query and looping statement for each one????
This would be much easier to create additional table "keywords" with the structure of KEYWORD - KEYWORDCOUNT.
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Thanks guys. I guess I need to have better database management.