How do I make this conditional look for empty query?
<p>Edited for clarity:
Let me start by saying I'm new to this-alright?  </p>

<p>I'm trying to send an email to a user if the $query is not NULL.  How do I do that?  I've tried a few different ways, but I'm not getting it right.  I have:</p>

<pre><code> $query = "SELECT * FROM  events  WHERE UserID='$UserID' AND ParentEventID IS NULL";
 $result = mysql_query($query);

  if ($result != "0") {
  //Mail user if there are events:
 $to = "example@example.com";
 $subject = "New Events found!!";
 $body = "Hi!";
 if (mail($to, $subject, $body)) {
   echo("&lt;p&gt;Message successfully sent!&lt;/p&gt;");
  } else {
   echo("&lt;p&gt;Message delivery failed...&lt;/p&gt;");

  }
</code></pre>

<p>What I am trying to achieve is if the database sends back anything from <code>events</code> (IE if <code>ParentEventID</code> does indeed have items with a <code>NULL</code> value) then the email will be sent-otherwise it will not be sent.</p>
