xampp import large db file Get link Facebook X Pinterest Email Other Apps - October 22, 2019 C:\xampp\mysql\bin>mysql -h localhost -u root {DATABASE_NAME} < PATH/SQL/FILE Get link Facebook X Pinterest Email Other Apps Comments
Blogger post using PHP API - March 31, 2017 <?php error_reporting(E_ALL); ini_set('display_errors',1); session_start(); require_once dirname(__FILE__) . '/GoogleClientApi/src/Google/autoload.php'; require_once dirname(__FILE__).'/GoogleClientApi/src/Google/Client.php'; require_once dirname(__FILE__).'/GoogleClientApi/src/Google/Service.php'; require_once dirname(__FILE__).'/GoogleClientApi/src/Google/Model.php'; require_once dirname(__FILE__).'/GoogleClientApi/src/Google/Collection.php'; require_once dirname(__FILE__).'/GoogleClientApi/src/Google/Config.php'; require_once dirname(__FILE__).'/GoogleClientApi/src/Google/Service/Resource.php'; require_once dirname(__FILE__).'/GoogleClientApi/src/Google/Service/Blogger.php'; //echo '<pre>'; $scriptUri = "<redirect url>"; $client = new Google_Client(); $client->setAccessType('online'); // default: offline $client->setApplicationName('<appName... Read more
php db functions - April 06, 2017 <?php class MarketplaceWebService_DB { function __construct($dbHost,$dbUsername,$dbPassword,$dbName){ // Connect database $conn = new mysqli($dbHost, $dbUsername, $dbPassword, $dbName); if($conn->connect_error){ die("Failed to connect with MySQL: " . $conn->connect_error); }else{ $this->db = $conn; } } function getRecord($table,$where=array()){ $sql = "SELECT * FROM $table Where 1=1"; if(!empty($where)){ foreach($where as $key=>$val){ $sql .=' AND '.$key." = '".$val."'"; } } $query = $this->db->query($sql); $result = $query->fetch_all(); if($result){ return $result; }else{ return false; } } function getSingleRecord($table,$where=array()){ $sql = "SELECT * FROM $table Where 1=1"; if(!empty($where)){ foreach($where as $key=>$val){ $sql .=' AND '.$key." = '".$val."... Read more
php scrapping - May 04, 2017 function file_get_contents_curl($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); $data = curl_exec($ch); curl_close($ch); return $data; } $htmldata = file_get_contents_curl('http://bascousa.com/kraft-self-seal-bubble-mailers-bmb857ss.html'); $error = false; if($htmldata){ $domdocument= new DOMDocument; $internalErrors = libxml_use_internal_errors(true); $domdocument->loadHTML($htmldata); libxml_clear_errors(); //remove errors for yucky html $readhtml_xpath = new DOMXPath($domdocument); $name = array(); $articlename = $readhtml_xpath->query('//div[contains(@id,"content_features")]/div'); if($articlename->length > 0 && !$error){ ... Read more
Comments
Post a Comment