Jump to content

Can anyone see where any repition would occur in this query?


aeroswat

Recommended Posts

I am getting about 40-50 more results than what should be displayed. Can't figure out why so i assume this is the cause of the problem.

 

				$qry1 = "SELECT StudentNumber FROM tblStudents WHERE isVisual='1' AND (((LENGTH(eyeRight) > 3 AND SUBSTR(eyeRight,4)>199) AND (LENGTH(eyeLeft) > 3 AND SUBSTR(eyeLeft,4)>199)) OR eyeRight IN ('OP', 'FDB', 'NIL', 'LP', 'CF', 'HM', 'VF')) AND SchoolSystem='" . $res0['systemName'] . "'";
			$qry2 = "SELECT StudentNumber FROM tblStudents WHERE isVisual='1' AND (((LENGTH(eyeRight) > 3 AND SUBSTR(eyeRight,4)<200) OR (LENGTH(eyeLeft) > 3 AND SUBSTR(eyeLeft,4)<200)) OR eyeRight NOT IN ('OP', 'FDB', 'NIL', 'LP', 'CF', 'HM', 'VF')) AND SchoolSystem='" . $res0['systemName'] . "'";

 

I run both of these queries and the possible inputs (as far as I know) are any of the following:

20/(some number between 0 and 9999)

NIL

LP

CF

OP

FDB

HM

VF

I am getting about 40-50 more results than what should be displayed. Can't figure out why so i assume this is the cause of the problem.

 

				$qry1 = "SELECT StudentNumber FROM tblStudents WHERE isVisual='1' AND (((LENGTH(eyeRight) > 3 AND SUBSTR(eyeRight,4)>199) AND (LENGTH(eyeLeft) > 3 AND SUBSTR(eyeLeft,4)>199)) OR eyeRight IN ('OP', 'FDB', 'NIL', 'LP', 'CF', 'HM', 'VF')) AND SchoolSystem='" . $res0['systemName'] . "'";
			$qry2 = "SELECT StudentNumber FROM tblStudents WHERE isVisual='1' AND (((LENGTH(eyeRight) > 3 AND SUBSTR(eyeRight,4)<200) OR (LENGTH(eyeLeft) > 3 AND SUBSTR(eyeLeft,4)<200)) OR eyeRight NOT IN ('OP', 'FDB', 'NIL', 'LP', 'CF', 'HM', 'VF')) AND SchoolSystem='" . $res0['systemName'] . "'";

 

I run both of these queries and the possible inputs (as far as I know) are any of the following:

20/(some number between 0 and 9999)

NIL

LP

CF

OP

FDB

HM

VF

 

I figured it out :P I wasn't checking to make sure that the lefteye had one of the string fields. Thanks anyways

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.