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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.