scotchegg78 Posted August 27, 2007 Share Posted August 27, 2007 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. Quote Link to comment Share on other sites More sharing options...
Illusion Posted August 28, 2007 Share Posted August 28, 2007 U missed where condition.... where lead.leadid=comapny.leadid and NetworkID LIKE '3' ; Quote Link to comment Share on other sites More sharing options...
fenway Posted August 28, 2007 Share Posted August 28, 2007 It's a JOIN condition... use a proper JOIN and it will be obvious you're missing the on clause. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.