Is there a shorter way of determining if a field contains text?
This works but I wonder if I can K.I.S.S. it? I really only need to know
if there is or is not a field containing the text specified. I don't
need to see it.
  // Request the text
  $text = "Joe of Egypt";
  $sql = "SELECT title FROM book WHERE title LIKE '$text'";
  $result = mysql_query($sql);
  if (!$result) {
    echo("<P>Error performing query: " .
         mysql_error() . "</P>");

  // Display the text
  while ( $row = mysql_fetch_array($result) ) {
    echo("<P>" . $row["title"] . "</P>");
  if ($row["title"] == "")
      echo ("Empty!")



Phil Jourdan ---

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to