Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2010
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. try {
  2.     if(!mysql_connect()){
  3.         throw new myException();
  4.     }
  5.     $result = mysql_query($query);
  6.     if(!$result){
  7.         throw new myException();
  8.     }
  9.     while($data = mysql_fetch_row($result)){
  10.         if(!is_readable($data['file'])){
  11.             throw new myException();
  12.         }
  13.         $fileContent = file_get_contents($data['file']);
  14.         if(strpos($fileContent,'asdfg') !== 0){
  15.             throw new myException();
  16.         }
  17.         //...
  18.     }
  19.     $message = 'все нормально';
  20. } catch (myException $e) {
  21.     $message = 'ошибка';
  22. }
  23. echo $message;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement