ADODB ADB sample

  1. global $adb;
  2. $sql = "SELECT website as web from table where website <> '' LIMIT ".$limitstart.",".$limit;
  3. $result = $adb->Execute($sql);
  4. if ($result === false) die("failed 1");
  5.  
  6. if (!empty($result)){
  7. for ($i = 1; $i <= $result->_numOfRows; $i++){
  8. $domain = $result->fetchRow();
  9. $domain = $domain['web'];
  10. $domain = hostname_strip($domain);
  11. $sql = 'INSERT INTO bidata.domaincrawl_domain (domain) VALUES ("'.$domain.'")';
  12. $result2 = $adb->Execute($sql);
  13. if ($result2 === false) echo " == failed 2";
  14. echo PHP_EOL.$i." - ". $domain;
  15. }
  16. }

 

Leave a Reply

You must be logged in to post a comment.