Basically, I am working on a realty listings database and on the agent's admin page, I want to display a count of the number of listings an agent has (table "homes") and how many house images the agent has (table "home_photo). I'd like to display this information on the pagetop.php template that gets added to the agent admin page.
Here's the main part of the "homes" table structure:
CREATE TABLE homes (
id int(11) DEFAULT '0' NOT NULL auto_increment,
owner int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (id),
KEY owner (owner),
);
Here's the main part of the "home_photo" table structure:
CREATE TABLE home_photo (
id smallint(6) DEFAULT '0' NOT NULL auto_increment,
agent_id smallint(6) DEFAULT '0' NOT NULL,
home_id smallint(6) DEFAULT '0' NOT NULL,
PRIMARY KEY (id)
);
home_photo.agent_id relates to homes.owner and home_photo.home_id relates to homes.id
So I'd like to count homes.owner AND home_photo.agent_id.
Thank you for your time and effort. If you need more information, please let me know and I'll post it right away.
Jason.