manglen id
Hej hvordan får jeg den til at printe ID ud på mysql tablen der hvor den henter hostname det virker fint med udprint af meta descriptionKode:
<?php
// Connect to the database
include 'dbconfig1.php';
include 'dbopen1.php';
function page_title($url) {
$page = @file_get_contents($url);
if (!$page) return null;
$matches = array();
if (preg_match('|<meta[^>]*description[^>]*content=\"([^>]+)\"[^>]*>|Ui', $page, $matches)) {
if(count($matches) > 0)
$description= $matches[1];
else
$description='';
print '<table style="border:1px solid #033333;margin:10px;width:600px"><tr><td>Meta Description:</td><td>'.$id.','.$description.'</td></tr></table>';
}
}
$antal = mysql_result(mysql_query("SELECT COUNT(*) FROM hostlist"),0);
for($i = 1; $i < $antal; $i++){
$query = "SELECT id,hostname,port,text2Index,lastvisit,indexed_pages,time_sec,bytes_downloaded,error_pages,priority,httpstatus,reklame FROM hostlist WHERE id = $i LIMIT 1" ;
$result = mysql_query($query);
while (list($id,$hostname,$port,$text2Index,$lastvisit,$indexed_pages,$time_sec,$bytes_downloaded,$error_pages,$priority,$httpstatus,$reklame)= mysql_fetch_row($result)){
if (page_title("http://$hostname")){
}
}
//Pause på 1 sekund.
if(($i % 500) == 500){
sleep(1);
}
}
mysql_close($conn);
?>