title: Is there a static way to throw exception in php
body: <p>Is there a "static" way of throwing an exception in php?</p>
  
  <p>I need to throw an exception when a mysql query fails.</p>
  
  <p>I tried this:</p>
  
  <pre><code>$re=@mysql_query( $query ) or throw new Exception(' Query Failed ');
  </code></pre>
  
  <p>but it's not working.</p>
  
  <p>And I'm using a function based on the <a href="http://php.net/manual/en/language.exceptions.php#81960" rel="nofollow"><code>throwException()</code> function from this comment at <strong>PHP: Exceptions manual</strong></a>, but I would like to know if there is a static way for doing this without making a class.</p>