I thing the problems is the time limit on your Server.
Try this now:
Test the var before insert into db:
If(!isset($crime)){$crime=3D''}
After u remove from the db the unwanted lines.
On the end of the file u do this:
$letters=3Darray();
for($i=3D'A';$i<=3D'Z';$i++){$letters[$i]=3D$i;if($i=3D=3D'Z'){break;}}
$tL=3Dcount($letters);
$letters=3Darray_keys($letters);
if(isset($_GET['L'])){if(trim($_GET['L'])!=3D=3D''){if($_GET['L']+1>$tL){=
$next=3D0
;$final=3D1;}else{$next=3D$_GET['L'];}}else{$next=3D0;}}else{$next=3D0;}
$nextLetter=3D$letters[$next];
if(!isset($final)){
//do the task
=09
//on the end of the file u put this:
for($i=3D0;$i<$tL;$i++){if($nextLetter=3D=3D$letters[$i]){if($i+1=3D=3D$t=
L){$nextLette
r=3D0;$file=3D'A';}else{$nextLetter=3D$i+1;$file=3D$letters[$i+1];}break;=
}}
#header('Location:'.$file.'.php?L=3D'.$nextLetter);
}
U'll need to make A.php, B.php, C.php, D.php, etc... file, with the same
Zechim
Enviada em: ter=E7a-feira, 12 de maio de 2009 10:24
Para: Phpster; Miller, Terion
Cc: J=F4natas Zechim; PHP-General List
Assunto: Re: RES: [PHP] CURL problems still
Yep, that's it
$_thing =3D '';
Bastien
Well I tried it and still it stopped at the "C's" maybe I put them in =
the
wrong spot? I tried something yesterday where I commented out the "C's"
url, and it ran through the "F's" could a setting somewhere be =
restricting
how many files it can run...I am just stumped, the script runs fine, =
inserts
the data I'm wanting etc, just can't get it to run all 26 pages....argh.
Code------------------
foreach($html->find('table') as $table) { foreach($table->find('tr') =
as
$tr) { //set variables to nada ? $name =3D ''; $age =3D =
'';
$warrant =3D ''; $bond =3D ''; $wnumber =3D ''; $crime =3D '';
// Grab children $cells =3D $tr->children();
if($cells[0]->plaintext !=3D "Name") { for ($i =
$i < count($cells); $i++) {
switch ($i){ case 0: // Name $name =
$cells[$i]->plaintext; echo $cells[$i]->plaintext;
break; case 1: // Age $age =3D
$cells[$i]->plaintext; break; case =
2: //
Warrant type $warrant =3D $cells[$i]->plaintext;
break; case 3: // Bond amount $bond =
$cells[$i]->plaintext; break; case =
4: //
Warrant number $wnumber =3D $cells[$i]->plaintext;
break; case 5: // Offence description
$crime =3D $cells[$i]->plaintext; break;
Default: echo "Uh-oh"; }
} } // Build your
INSERT statement here $query =3D "INSERT into `warrants` =
(name,
age, warrant, bond, wnumber, crime) VALUES ("; $query .=3D " '$name',
'$age', '$warrant', '$bond', '$wnumber', '$crime' )"; $wid =3D
mysql_insert_id(); echo $query; // run =
query
mysql_query($query) or die (mysql_error());
| Article list | Name | Date |
| Currently Viewing : This Article | Jônatas Zechim | 2009-05-12 14:07:41 |












