Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8676697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:15:50+00:00 2026-06-12T20:15:50+00:00

I crawled pdf link from web, I want to copy the pdf that doesn’t

  • 0

I crawled pdf link from web, I want to copy the pdf that doesn’t exist yet in database by check out the name of document (that I get from link) with the name of document that exist in database.
here’s the code :

$input = explode(" ",trim(basename($pdfLink, ".pdf"),"() "));
$sql   = mysql_query("SELECT doc_name FROM tb WHERE doc_name ='$input'")or die(mysql_error());
if (!$sql){
    copy($pdfLink, $savePath . basename($pdfLink));
}

$pdfLink is string of PDFlinks. but, copy process didn’t work. what’s wrong? thank you 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T20:15:51+00:00Added an answer on June 12, 2026 at 8:15 pm

    It is better for you to check count of related records in DB

    $input = explode(" ",trim(basename($pdfLink, ".pdf"),"() "));
    $sql   = mysql_query("SELECT COUNT(*) AS cnt FROM tb WHERE doc_name ='$input'")
             or die(mysql_error());
    $row   = mysql_fetch_assoc($sql);
    if ($row['cnt'] < 1){
      copy($pdfLink, $savePath . basename($pdfLink));
    }
    mysql_free_result($sql);
    

    or to count affected rows:

    $input = explode(" ",trim(basename($pdfLink, ".pdf"),"() "));
    $sql   = mysql_query("SELECT doc_name FROM tb WHERE doc_name ='$input' LIMIT 1")
             or die(mysql_error());
    $rows   = mysql_affected_rows($sql);
    if ($rows < 1){
      copy($pdfLink, $savePath . basename($pdfLink));
    }
    mysql_free_result($sql);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to extract text from crawled html web pages. I am using the
I crawled some datas from a web then directly save them in database, so
If I want to protect a folder from being crawled by robots that respect
I have a web crawler that looks for specific information I want and returns
I'm writing a web crawler and want to ignore URLs which link to binary
I crawled a web to get pdf documents in the web. for example, I
to save my web crawler position that how many pages it crawled i try
I'm writing a crawler for Ruby, and I want to honour the headers that
When I want to find a Big Web service (WS-*/WSDL based) of required functionality
Does a web crawler return the extracted text from webpages only? Say, if there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.