0

data Retrieve from Database

while($row_posts = mysql_fetch_array($run_posts))
    {
    $post_id1=$row_posts['userID'];
    $post_title=$row_posts['torrent_hash'];

check hash value with transmission software

try{
    $transmission = new Transmission\Transmission();
    $torrent = $transmission->get($post_title);
    $torrent->getName();
    }
    catch (Exception $e) {
          echo 'Caught exception: ',  $e->getMessage(), "\n";
       }

If Hash id not found in transmission then show error like below

Caught exception: Torrent with ID 58bd21a7938cb1d65f737bcb6031111816d924d9 not found 
Notice: Undefined variable: torrent in C:\xampp\htdocs\final\info.php on line 46

Fatal error: Call to a member function isFinished() on a non-object in C:\xampp\htdocs\final\info.php on line 46

I need Output Like If Runtime exception occurs then simply break the first loop and execute second value from database is that possible ?

0

1 Answer 1

1

Try command continue; in the catch block.

continue is used within looping structures to skip the rest of the current loop iteration and continue execution at the condition evaluation and then the beginning of the next iteration.

See Php manual

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.