when a search yeilds zero results...
Posted: Thu Aug 28, 2008 10:17 am
Hi there, I'm making a simple search function for my news article system
and I was wondering if anyone can tell me how I can detect when the search yields no results.
So when there's no matches, it says 'Sorry no matches' or whatever.
I'm doing the usual thing of a LIKE clause in my SELECT statement, and I've tried several things, such as:
if (empty($result)) {
or
if (empty($row)) {
or
if ($result == 0) {
etc etc
but none of them give the desired result
I'm sure this is a basic question, so why not help out a noob?
Thanks in advance,
Wilbo
and I was wondering if anyone can tell me how I can detect when the search yields no results.
So when there's no matches, it says 'Sorry no matches' or whatever.
I'm doing the usual thing of a LIKE clause in my SELECT statement, and I've tried several things, such as:
if (empty($result)) {
or
if (empty($row)) {
or
if ($result == 0) {
etc etc
but none of them give the desired result
I'm sure this is a basic question, so why not help out a noob?
Thanks in advance,
Wilbo