Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- if(!mysql_connect()){
- throw new myException();
- }
- $result = mysql_query($query);
- if(!$result){
- throw new myException();
- }
- while($data = mysql_fetch_row($result)){
- if(!is_readable($data['file'])){
- throw new myException();
- }
- $fileContent = file_get_contents($data['file']);
- if(strpos($fileContent,'asdfg') !== 0){
- throw new myException();
- }
- //...
- }
- $message = 'все нормально';
- } catch (myException $e) {
- $message = 'ошибка';
- }
- echo $message;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement