Jump to content


Photo

If search page returns blank, load page


  • Please log in to reply
2 replies to this topic

#1 bladechob

bladechob
  • Members
  • PipPipPip
  • Advanced Member
  • 99 posts
  • LocationDerby, UK

Posted 25 September 2006 - 11:39 AM

Hi, I'm new to all of this PHP stuff and need a hand please in trying to get a page to display if a search on my site comes back blank i.e. I am starting as villa rental site where you enter search criteria such as location, date range and property type, hit submit and it searches for availability in an sql database. At present if nothing is available on the dates chosen it kicks back to the search page. I need to get a page displayed for the viewer so that when the search returns blank it tells them why? Any ideas please?
To forgive is to forget... to forget is... what was I saying?

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 25 September 2006 - 11:55 AM

if (mysql_num_rows($result) == 0) {
  echo "Your query yielded no results";
}


#3 bladechob

bladechob
  • Members
  • PipPipPip
  • Advanced Member
  • 99 posts
  • LocationDerby, UK

Posted 25 September 2006 - 12:00 PM

Many thanks for that. I'll give it a go...
To forgive is to forget... to forget is... what was I saying?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users