tags:

views:

31

answers:

1

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();
}
+1  A: 

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

Naktibalda
Ya I just realized that as I was looking at it. Noob question. Thanks.
chenger