Re: RES: [PHP] CURL problems still
| From: | Nathan Rixham | Date: | Tue, 12 May 2009 13:46:22 +0000 |
| Subject: | Re: RES: [PHP] CURL problems still | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-292482@lists.php.net to get a copy of this message | ||
Miller, Terion wrote:
Well I tried it and still it stopped at the "C's"1: your script is timing out, you need to set the time limit higher set_time_limit(0); 2: foreach($html->find('table') as $table) { $rows = explode('</tr>' , $table ); $headerCells = explode('</th>', array_shift($rows)); $struct = array(); foreach( $headerCells as $c => $cell ) { $struct[] = str_replace(' ', '_', trim(strtolower(strip_tags( $cell )))); } $data = array(); foreach( $rows as $r => $row ) { $cells = explode( '</td>' , $row ); $item = array(); foreach( $cells as $c => $cell ) {
$item[$struct[$c]] = trim(strip_tags( $cell ));} $data[] = $item; $query = "INSERT into
warrants ";
$query .= "(name, age, warrant, bond, wnumber, crime)";
$query .= " VALUES (";
$query .= " '{$item['name']}',";
$query .= " '{$item['age']}',";
$query .= " '{$item['warrant_type']}',";
$query .= " '{$item['bond']}',";
$query .= " '{$item['warrant_number']}',";
$query .= " '{$item['offence_description']}'";
$query .= " )";
echo $query . "\n";
// run query here
}
}