Jump to content

Mysql count issue when where uses two tables?


scotchegg78

Recommended Posts

hey guys

 

I have to count the rows so use

$query   = "SELECT COUNT(LeadID) AS numrows FROM lead, company " . $query_qryDatacount;

 

i need company as the additional quety may have filters from this table at times and sql errors if i leave it out and filters are selected.

But the problem is my row count is lead * company !?

and example of a filter on the query is

 

SELECT COUNT(LeadID) AS numrows FROM lead, company WHERE NetworkID LIKE '3'

but as i say, the row count is both tables multiplied together, all i want is the total leads that use a companyid on a network 3.

with me?

 

cheers ma dears.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.