HowdeeDoodee
Technical User
I am getting a MySql syntax error message when this statement is used. I cannot find the error. The statement is searching for two parts of a text string with the first part of the string ending with a colon and the second part of the string containing a dash. The field name is References. $PartAPartB is the first part of the string to be found, $PartC is the second part of the string to be found. When I run the statement through phpMyAdmin and substitute real values for $PartAPartB and $PartC, no error comes up.
Thank you in advance for any replies.
Code:
OR ((LOCATE('-', `References`) > 0 AND LOCATE('". $PartAPartB3 . "', `References`) > 0 AND ". $PartC3 ." BETWEEN SUBSTRING_INDEX(SUBSTRING_INDEX(`References`, ':', -1), '-', 1) + 0 AND SUBSTRING_INDEX(`References`, '-', -1) + 0) AND `Source` = $ES
OR ((LOCATE('-', `References`) > 0 AND LOCATE('". $PartAPartB4 . "', `References`) > 0 AND ". $PartC4 ." BETWEEN SUBSTRING_INDEX(SUBSTRING_INDEX(`References`, ':', -1), '-', 1) + 0 AND SUBSTRING_INDEX(`References`, '-', -1) + 0) AND `Source` = $NV)
Thank you in advance for any replies.