I have a search box on my website, that allows users to look for items that have been posted by other users, I am using this code a the moment, but there is a problem with it

$category=$_GET['cat'];
$text=$_GET['text'];
$query=mysql_query("
	SELECT *
	FROM event_information
	WHERE category='" . $category . "'
	AND keywords LIKE '%" . $text . "%'
	LIMIT 0, 25");

The problem with this is that say someone was searching for 'chris rock live' and there was an entry it would be fine, bt if they searched for 'live chris rock' then they would not get anything from the database. Is there a way using php that I can take their query and set an array or something to hold the values of each word separatley and include each word in the query

Thanks for looking

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.