squiblo Posted February 8, 2010 Share Posted February 8, 2010 My query searches for people in the database. If the user searches "bob" it with output "bob marley". If the user searches "marley" it will output "bob marley" also. If the user searches "bob marley" nothing will be outputted how can i explode this... $search = $_POST['search_friend']; to make this query work properly... $search_name_check = mysql_query("SELECT * FROM page_set_data WHERE forname='$search' OR surname='$search'"); Thanks Link to comment https://forums.phpfreaks.com/topic/191376-exploding-_post-for-a-query/ Share on other sites More sharing options...
squiblo Posted February 8, 2010 Author Share Posted February 8, 2010 :confused: Link to comment https://forums.phpfreaks.com/topic/191376-exploding-_post-for-a-query/#findComment-1008942 Share on other sites More sharing options...
wildteen88 Posted February 8, 2010 Share Posted February 8, 2010 Use explode with a space as the first parameter. Example list($search_forname, $search_surname) = explode(' ', $_POST['search_friend']); Link to comment https://forums.phpfreaks.com/topic/191376-exploding-_post-for-a-query/#findComment-1008980 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.