Sign Up Login Videos
0

webcrawler /search engine

0

webcrawler /search engine

please fin beloow code form i can't seem to get any results in my data base it works up untill i get the crawler to add the data

$details = json_decode(get_details($l));

            echo $details->URL." ";

            $rows = $pdo->query("SELECT * FROM `sites` WHERE url_hash='".md5($details->URL)."'");
            $rows = $rows->fetchColumn();

            $params = array(':title' => $details->Title, ':description' => $details->Description, ':keywords' => $details->Keywords, ':url' => $details->URL, ':url_hash' => md5($details->URL));

             if ($rows > 0) {
               if (!is_null($params[':title']) && !is_null($params[':description']) && $params[':title'] != '') {

               $result = $pdo->prepare("UPDATE `sites` SET title=:title, description=description keywords=:keywords, url=:url, url_hash=:url_hash, WHERE url_hash=:url_hash");
               $result = $result->execute($params);
               }
             } else {
       if (!is_null($params[':title']) && !is_null($params[':description']) && $params[':title'] != '') {
               $result = $pdo->prepare("INSERT INTO `sites` VALUES ('', :title, :description, :keywords, :url, :url_hash)");
               $result = $result->execute($params);
  • PHP
  • SQL

0 Replies

x