Query count
Posted: Sat May 12, 2007 11:42 am
feyd | Please use
Do i make query for each content and then count it, or is there simpler way.
Thanks
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi
I am trying to make count of specific content in mysql database
For example: i want to make content menu and for each content i want to know how many headlines is in content.
Sports(15) // 15 headlines in content Sports
Politics(10) // 10 headlines in content Politics
Music(3) // 3 headlines in content Music
My database look like this:
[syntax="sql"]
CREATE TABLE headlines (
id INT NOT NULL auto_increment,
title TEXT NOT NULL,
text TEXT NOT NULL,
contid INT NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE content(
contid int not null,
contentname text,
about text,
PRIMARY KEY(contid)
);
Thanks
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]