by aspi » 25. June 2005 23:17
Thanks for your response. I also did not find a note for any such constraint/bug anywhere in web postings.
Below is my php code snippet.
$query = "SELECT bookid FROM review ORDER BY modified DESC AND bookid IN (SELECT id FROM book WHERE title LIKE '%ar%' UNION SELECT bookid FROM author, bookauthor WHERE id = authorid AND (last LIKE '%ar%' OR first LIKE '%ar%' OR initials LIKE '%ar%'))";
$result = mysql_query($query);
if ($result) {
// do action
} else {
echo "Error searching:" . mysql_error();
}
It gives me the following sql error:
Error searching: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 bookid IN (SELECT id FROM book WHERE title LIKE '%ar%' UNION SELECT bookid F' at line 1
The place where the string in the error message above terminates, "bookid F", if I count its position in the original query string, it is 128 characters. That is why I assumed that likely somewhere in the Windows port of mysql that I am using under php, the query string is being truncated.
I have Xampp 1.4.13, php version 5.0.4, mysql version 4.1.7