[TYPO3-mvc] MySQL Error

Kevin Meckl kevin.meckl at web-dat.de
Fri Apr 26 12:16:50 CEST 2013


This code snippet is the repository and get the following error message

public function searchFor($searchFields, $searchQuery) {
	$query = $this->createQuery();
	$constraint = array();

	foreach ($searchFields as $field) {
		$constraint[] = $query->like($field, '%' . $searchQuery . '%');
	}
	$query = $query->matching(
		$query->logicalOr(
			$constraint
	       )
	);
	$query->setLimit(60);

	$query->setOrderings(array('last_name' => Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING));

         return $query->execute();
}

ERROR	
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 'LIKE '%Test%' AND fe_users.deleted=0 AND fe_users.disable=0 AND fe_users.startti' at line 1

lastBuiltQuery
SELECT fe_users.* FROM fe_users WHERE fe_users. LIKE '%Test%' AND fe_users.deleted=0 AND fe_users.disable=0 AND fe_users.starttime<=1366970940 AND (fe_users.endtime=0 OR fe_users.endtime>1366970940) AND fe_users.pid IN (29) LIMIT 60

What can be wrong, can help me?

Best regars


More information about the TYPO3-project-typo3v4mvc mailing list