Unable to connect to the database server at this time.

" ); exit(); } if (! @mysql_select_db("mydatabase") ) { echo( "

Unable to locate the database at this time.

" ); exit(); } else { $goog_www = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=site:".$tld.""; $ch = curl_init($goog_www); curl_setopt ( $ch, CURLOPT_USERAGENT, "Internet Explorer" ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $str = curl_exec( $ch ); preg_match( "/estimatedResultCount\"\:\"(.*?)\",\"curr/is", $str, $www_result); $goog_porn = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=site:".$tld."%20porn"; $ch = curl_init($goog_porn); curl_setopt ( $ch, CURLOPT_USERAGENT, "Internet Explorer" ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $str = curl_exec( $ch ); preg_match( "/estimatedResultCount\"\:\"(.*?)\",\"curr/is", $str, $porn_result); $goog_hockey = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=site:".$tld."%20hockey"; $ch = curl_init($goog_hockey); curl_setopt ( $ch, CURLOPT_USERAGENT, "Internet Explorer" ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $str = curl_exec( $ch ); preg_match( "/estimatedResultCount\"\:\"(.*?)\",\"curr/is", $str, $hockey_result); mysql_query("INSERT IGNORE INTO tld_db (tld, www_result, porn_result, hockey_result) VALUES ('".$tld."', '".$www_result[1]."', '".$porn_result[1]."', '".$hockey_result[1]."')"); } } ?>