AGSUProgrammer wrote:It was the space at the end of the query that was giving the error.
More accurately, the lack of a space at one of your strings that would be joined to form the entire SQL statement.
In the future, you may find it easier to do this:
$myQuery = "SELECT DISTINCT USER_PIDM, USER_UNAME, USER_STUID
FROM MYGSUSER, MYGSUROL WHERE UCASE(USER_FNAME)='$ENTER_FNAME'
AND UCASE(USER_LNAME)='$ENTER_LNAME'
AND USER_BDATE='$ENTER_BDATE'
AND USER_STUID='$ENTER_EAGLEID'
AND USER_PIDM=UROL_PIDM";
But then I notice that the variables take their values from incoming variables, and yet were not properly sanitised. Therefore, you can consider:
$myQuery = sprintf("SELECT DISTINCT USER_PIDM, USER_UNAME, USER_STUID
FROM MYGSUSER, MYGSUROL WHERE UCASE(USER_FNAME)='%s'
AND UCASE(USER_LNAME)='%s'
AND USER_BDATE='%s'
AND USER_STUID='%s'
AND USER_PIDM=UROL_PIDM",
mysql_real_escape_string($ENTER_FNAME),
mysql_real_escape_string($ENTER_LNAME),
mysql_real_escape_string($ENTER_BDATE),
mysql_real_escape_string($ENTER_EAGLEID));