Follow Me:

Friday 28 February 2014

What is .frm, .myi, .myd. txt file in PhpMyadmin and MySQl?

When creating the table in database,that time 3 text file is generated in local.That files are 
 .FRM  =>  It has the table structure of your table or table definition

 .MYI  =>   It has the indexes of your table

 .MYD =>   It contains your data

Generally you can find the data directory of your file with your .my.cnf file. The physical structure of db is some thing like a directory structure, where each database is a subdirectory under the main directory and has some files in it. Each table has its own file. Bascially one can see three types of files .frm, .myi, .myd.. But they are not same for all tables and db. They differ based on the engines you use and sometimes even differ with the os. There are lots of other factors that is in the backend behind the type of files you see. We will  see some basic differences.

For ex: if your db name is school and tables called class and student. The Physical structure will have a directory called school and files class.frm, class.myi, class.myd, student.frm, student.myi, student.myd.

Thursday 13 February 2014

  To import csv files into the mysql table,for this removing the header of the csv files and then run the below script.It will be insert into our mysql table.

//Import csv files into mysql table

LOAD DATA LOCAL INFILE 'd:\\Site.csv' INTO TABLE `siteurl` 
FIELDS TERMINATED BY ',' ENCLOSED BY '"' 
LINES TERMINATED BY '\r\n';

//ends


Character Escape Sequence

\0 An ASCII NUL (0x00) character
\b A backspace character
\n A newline (linefeed) character
\r A carriage return character
\t A tab character
\Z ASCII 26 (Control+Z)
\N NULL

Note : Your File must be a Csv file.Then only it will be working.
  Csv File Name as Site.csv
  Table Name as siteurl

Csv Files import in MySql, Csv Files import in php, Import CSV Files into MySQL table

Monday 3 February 2014

    By using array_diff() function , we can remove the array values in php
    <?php

   <?php
       $arr_remove = array('Codingslover', 'webslessons', 'meetcity', 
       'eshopoffers','google'); $arr = array_diff($arr_remove, array('webslessons', 'google')); echo "<pre>";print_r($arr_remove); echo "<pre>";print_r($arr); ?>

Monday 11 February 2013

FedEx Web Services is the next generation API for integrating software applications with FedEx Systems. Web services represent the future application integration because they offer the following:
  • Inter-operability: Any Web service can interact with any other Web service and can be written in any language.
  • Ubiquity: Web services communicate using HTTP and XML--So any connected device that supports these technologies can both host and access Web Services.
  • Low Barrier to Entry: The concepts behind Web services are easy to understand, and developers can quickly create and deploy them using many tool-kits available on the web.
  • Industry Support: Major content providers and vendors are supporting the Web services movement.



View the Demo

Fedex Shipping Integration For International priority

The international priority for FedEx Shipping Codes is given below:
Codings:

<?php

// Copyright 2009, FedEx Corporation. All rights reserved.
// Version 12.0.0
require_once('../../../library/fedex-common.php5');
//The WSDL is not included with the sample code.
//Please include and reference in $path_to_wsdl variable.
$path_to_wsdl = "../../../wsdl/ShipService_v12.wsdl";


// PDF label file. Change to file-extension .pdf for creating a PDF label
define('SHIP_LABEL', 'shipexpresslabel.pdf');  
ini_set("soap.wsdl_cache_enabled", "0");

// Refer to http://us3.php.net/manual/en/ref.soap.php for more information
$client = new SoapClient($path_to_wsdl, array('trace' => 1)); 

$request['WebAuthenticationDetail'] = array(
 'UserCredential' =>array(
 'Key' => getProperty('key'), 
 'Password' => getProperty('password')
 )
);

$request['ClientDetail'] = array(
 'AccountNumber' => getProperty('shipaccount'), 
 'MeterNumber' => getProperty('meter')
);

$request['TransactionDetail'] = array('CustomerTransactionId' => '
*** Express International Shipping Request v12 using PHP ***');
$request['Version'] = array(
 'ServiceId' => 'ship', 
 'Major' => '12', 
 'Intermediate' => '1', 
 'Minor' => '0'
);

$request['RequestedShipment'] = array(
 'ShipTimestamp' => date('c'),
 'DropoffType' => 'REGULAR_PICKUP',
 'ServiceType' => 'INTERNATIONAL_PRIORITY', 
 'PackagingType' => 'YOUR_PACKAGING', 
 'Shipper' => addShipper(),
 'Recipient' => addRecipient(),
 'ShippingChargesPayment' => addShippingChargesPayment(),
 'CustomsClearanceDetail' => addCustomClearanceDetail(),                                                                                                       
 'LabelSpecification' => addLabelSpecification(),
 'CustomerSpecifiedDetail' => array(
  'MaskedData'=> 'SHIPPER_ACCOUNT_NUMBER'
 ), 
 'RateRequestTypes' => array('ACCOUNT'), // valid values ACCOUNT and LIST
 'PackageCount' => 1,
 'RequestedPackageLineItems' => array(
  '0' => addPackageLineItem1()
 ),
 'CustomerReferences' => array(
  '0' => array(
   'CustomerReferenceType' => 'CUSTOMER_REFERENCE', 
   'Value' => 'TC007_07_PT1_ST01_PK01_SNDUS_RCPCA_POS'
  )
 )
);

try
{
 if(setEndpoint('changeEndpoint'))
 {
  $newLocation = $client->__setLocation(setEndpoint('endpoint'));
 }
 // FedEx web service invocation
 $response = $client->processShipment($request); 
 if($response->HighestSeverity 
!= 'FAILURE' && $response->HighestSeverity != 'ERROR')
 {
  printSuccess($client, $response);
  // Create PNG or PDF label
  // Set LabelSpecification.ImageType to 'PDF' for generating a PDF label
  $fp = fopen(SHIP_LABEL, 'wb');   
  fwrite($fp, ($response->CompletedShipmentDetail->CompletedPackageDetails
->Label->Parts->Image));
  fclose($fp);
  echo 'Label <a href="./'.SHIP_LABEL.'">'.SHIP_LABEL.'</a> was generated.';            
 }
 else
 {
  printError($client, $response);
 }
 writeToLog($client);    // Write to log file
} catch (SoapFault $exception) {
 printFault($exception, $client);
}

function addShipper(){
 $shipper = array(
  'Contact' => array(
   'PersonName' => 'Sender Name',
   'CompanyName' => 'Sender Company Name',
   'PhoneNumber' => '1234567890'
  ),
  'Address' => array(
   'StreetLines' => array('Address Line 1'),
   'City' => 'Austin',
   'StateOrProvinceCode' => 'TX',
   'PostalCode' => '73301',
   'CountryCode' => 'US'
  )
 );
 return $shipper;
}

function addRecipient(){
 $recipient = array(
  'Contact' => array(
   'PersonName' => 'Recipient Name',
   'CompanyName' => 'Company Name',
   'PhoneNumber' => '1234567890'
  ),
  'Address' => array(
   'StreetLines' => array('Address Line 1'),
   'City' => 'Richmond',
   'StateOrProvinceCode' => 'BC',
   'PostalCode' => 'V7C4V4',
   'CountryCode' => 'CA',
   'Residential' => false
  )
 );
 return $recipient;                                    
}

function addShippingChargesPayment(){
 $shippingChargesPayment = array(
  'PaymentType' => 'SENDER',
  'Payor' => array(
   'ResponsibleParty' => array(
    'AccountNumber' => getProperty('billaccount'),
    'Contact' => null,
    'Address' => array('CountryCode' => 'US')
   )
  )
 );
 return $shippingChargesPayment;
}

function addLabelSpecification(){
 $labelSpecification = array(
  'LabelFormatType' => 'COMMON2D', // valid values COMMON2D, LABEL_DATA_ONLY
  'ImageType' => 'PDF',  // valid values DPL, EPL2, PDF, ZPLII and PNG
  'LabelStockType' => 'PAPER_7X4.75');
 return $labelSpecification;
}

function addSpecialServices(){
 $specialServices = array(
  'SpecialServiceTypes' => array('COD'),
  'CodDetail' => array(
  'CodCollectionAmount' => array('Currency' => 'USD', 'Amount' => 150),
  'CollectionType' => 'ANY')// ANY, GUARANTEED_FUNDS
 );
 return $specialServices; 
}

function addCustomClearanceDetail(){
 $customerClearanceDetail = array(
  'DutiesPayment' => array(
   'PaymentType' => 'SENDER', //valid values RECIPIENT,SENDER and THIRD_PARTY
   'Payor' => array(
    'ResponsibleParty' => array(
     'AccountNumber' => getProperty('dutyaccount'),
     'Contact' => null,
     'Address' => array('CountryCode' => 'US')
    )
   )
  ),
  'DocumentContent' => 'NON_DOCUMENTS',                                                                                            
  'CustomsValue' => array(
   'Currency' => 'USD', 
   'Amount' => 100.0
  ),
  'Commodities' => array(
   '0' => array(
    'NumberOfPieces' => 1,
    'Description' => 'Books',
    'CountryOfManufacture' => 'US',
    'Weight' => array(
     'Units' => 'LB', 
     'Value' => 1.0
    ),
    'Quantity' => 4,
    'QuantityUnits' => 'EA',
    'UnitPrice' => array(
     'Currency' => 'USD', 
     'Amount' => 100.000000
    ),
    'CustomsValue' => array(
     'Currency' => 'USD', 
     'Amount' => 400.000000
    )
   )
  ),
  'ExportDetail' => array(
   'B13AFilingOption' => 'NOT_REQUIRED'
  )
 );
 return $customerClearanceDetail;
}

function addPackageLineItem1(){
 $packageLineItem = array(
  'SequenceNumber'=>1,
  'GroupPackageCount'=>1,
  'Weight' => array(
  'Value' => 20.0,
  'Units' => 'LB'),
  'Dimensions' => array(
  'Length' => 20,
  'Width' => 20,
  'Height' => 10,
  'Units' => 'IN')
 );
 return $packageLineItem;
}
?>

Download the below Documents:

FedEx Intergrations Codings

More link:

http://www.codingslover.com/search/label/Api%20Integration