简体   繁体   中英

PHP connection issue and time out issue

I am having a problem trying to pull a path name from a DB in MySQL and then searching the path using Simple HTML DOM. The issue is that there are 2000+ entries and I know that is what is causing the connection issues.

Error Message : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

Code :

function add_title($path_array,$count){  
    $admin = new Admin();
    $admin->connect();
    for ($x=0 ;$x<$count;$x++)
    {
        $html = file_get_html($path_array[$x]);
        foreach($html->find('title') as $title_element){
            mysql_query("INSERT INTO images SET title='".$title_element."' WHERE path = '". $path_array[$x]."'");
        }
    }
    $admin->close_connection();
}

INSERT doesn't have WHERE. Do you want to INSERT or UPDATE?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM