PHP与MySQL Workbench:相同的查询,不同的结果

I have a situation apparently seen by others, but none of the solutions suggested seem to apply to my situation.

MySQL QUERY

select a.assessmentscheduledID, a.assessmentscheduledHVID, a.assessmentscheduledChildID, a.assessmentscheduledType, a.assessmentscheduledAssessmentID, a.assessmentscheduledDateSubmitted, b.pcnpyCurricYearID, b.pcnpyCurricLang from `hhpip_chairs`.tblAssessmentsScheduled a, `hhpip_chairs`.tblPCNPY b where a.assessmentscheduledAAStatus = 2 and a.assessmentscheduledAADistYN = 0 and a.assessmentscheduledChildID= b.pcnpyChildID;

In workbench this query 164 records.

PHP Code

$getassessout = "select a.assessmentscheduledID, a.assessmentscheduledHVID, a.assessmentscheduledChildID, a.assessmentscheduledType, a.assessmentscheduledAssessmentID, a.assessmentscheduledDateSubmitted, b.pcnpyCurricYearID, b.pcnpyCurricLang from tblAssessmentsScheduled a, tblPCNPY b where a.assessmentscheduledAAStatus = 2 and a.assessmentscheduledAADistYN = 0 and b.pcnpyChildID = a.assessmentscheduledChildID";
$getassessoutresults = $mysqli->query($getassessout) or trigger_error("<p class=\"error\">We're very sorry, but an error has occurred when interacting with the CHAIRS database.  Please try again and see if the error repeats.  If it does, please get the following information in its entirety to your database administrator so the CHAIRS developer can get the error resolved.<br />Error Message: " . $mysqli->error, E_USER_ERROR);

When this code runs on my web page, I get back 152 records. Any thoughts on why this may be the case?

There is a slight differnce between the queries:

and a.assessmentscheduledChildID= b.pcnpyChildID;

and b.pcnpyChildID = a.assessmentscheduledChildID;

Since you are using tbl1,tbl2 to join instead of the usual JOIN statement , I suspect the mysql engine is reading it differently. From the mysql manual :

STRAIGHT_JOIN(,) is similar to JOIN, except that the left table is always read before the right table. This can be used for those (few) cases for which the join optimizer puts the tables in the wrong order.