---- Steven Macintyre <steven@xxxxxxxxxxxxxxxxxxxxx> wrote: > Hi all, > > I have the following SQL statement; > > SELECT count( salesID ) AS count, branch_name, company_name, branch.branchID > FROM sales > LEFT JOIN IGuser ON sales.IGuid = IGuser.IGuid > LEFT JOIN branch ON IGuser.branchID = branch.branchID > LEFT JOIN company ON branch.companyID = '{$companyID}' > WHERE maincompanyid = '{$mcid}' > GROUP BY branch.branchID > ORDER BY branch_name ASC > > However, i do not want those join records to be appended, only to return the count of records from sales. > > Can someone assist me with this? I have tried differance variants of joins and none of the results are correct. > > Sales tbl doesnt have the companyID, nor does IGuser > > Regards, > > Steven Joins don't exist in PHP. You probably mean an SQL list to talk with depending on your database taste. Now, if you had some PHP code that was messing up, I'm all for checking it out and seeing if I can lend a hand ferreting out the issue. Wolf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php