开发者

PHP connection issue and time out issue

开发者 https://www.devze.com 2023-01-04 10:51 出处:网络
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

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 pro开发者_JAVA技巧perly 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?

0

精彩评论

暂无评论...
验证码 换一张
取 消