$SeeAlso is derived from the url calling the script and $SeeAlso carries one of the values to be found in both tables.
$query = "SELECT * FROM Comm_Clarke , BibleTextInserter2 WHERE Comm_Clarke.VerseRef = BibleTextInserter2.VerseRef AND (`BibleTextInserter2.VerseNum` >= $VerseNumLo) AND (`BibleTextInserter2.VerseNum` <= $VerseNumHi) AND (`BibleTextInserter2.VerseRef` = '$SeeAlso') AND (`Comm_Clarke.Source` = '$BRN')";
Here is the error message:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND (`BibleTextInserter2.VerseRef` = 'Gen 1:1') AND (`Comm_Clarke.Source` = ' at line 3
Thank you in advance for your replies.