Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • explain not working - the 2nd code block problem is obvious (isset return truw or false, so its never greater than 1), but what happens when you try the 1st code block Commented Aug 17, 2015 at 9:29
  • isset($query) && !empty($query) && strlen($query) > $min_length - can be done with !empty($query) only. Commented Aug 17, 2015 at 9:31
  • Is query actually retrieving a value from $_POST['name']? Check with var_dump($query); Commented Aug 17, 2015 at 9:33
  • @b0s3 i have tried "!empty($query)" but it is searching when there is no data as well. Commented Aug 17, 2015 at 9:34
  • What? That can't happen. If $query is empty then it will never get inside the block with !empty($query) if there are no mistakes. Commented Aug 17, 2015 at 9:37