Working with E2Save’s Affiliate CSV/XML Data Feeds

Recently I’ve been working on a web project for a client that required me to work with e2save, specifically their affiliate scheme. E2save (Which is part of the Carphone Warehouse) provide data feeds via their White Label affiliate scheme, the data contained in these feeds relate to everything you see on the current website – Phones, Tariffs, Gifts etc.

Now e2save offers two optional formats for the data feeds – XML or CSV. I was unsure which format to choose so initially went with the XML format, which proved to be.. frustrating. PHP certainly isn’t the best language to parse XML documents in, I found a lot of the implementations for parsing XML documents to be lacking, I.E the built in libraries and scripts found online just couldn’t handle the larger file size of these XML files, at least the older implementations couldn’t handle them.

The mobile_deals.xml file which contains the phone data is over 100 megabytes and contains over 10,000+ phones and as you can imagine even with a effcient well written function such as xml2array you will soon run into memory limitations, even on high end server systems.

However as of PHP 5 you can use the new XMLReader library, it allows processing of “XML documents in an efficient streaming mode” which basically breaks down to processing the document one element at a time. You can read more about it at IBM’s Developer Works

Example of a single product XML document provided by e2save. (Google Syntax Highlighter seems to mess up towards the end, so just view in plain text for the proper structure and values.)

 
 
 
2010-11-22 20:00:01 (1290456001) 
 
O2MIP3GS8B_EQ254FEB10_NA 
O2 
Apple 
iPhone 3G S 8GB Black 
 
185.00 
25.00 
100 
20 
20 
20 
20 
20 
20 
3 
12 
0 
10 
10 
 
 
20 
20 
 
 
http://WHITELABELCODE.e2save.com/mobile/phones/showBoxes.php?&B[0][next][0]=&B[0][handsetcode]=O2MIP3GS8B 
http://WHITELABELCODE.e2save.com/image.php?size=large&&handsetcode=O2MIP3GS8B 
http://WHITELABELCODE.e2save.com/image.php?size=small&&handsetcode=O2MIP3GS8B 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Y 
 
 
 
 
 
XNET 
 
 
Unlimited 
 
N 
 
24 
0 
 
IPHONE 
 
O2 
 
 
 
 
 
Black 
 
 
$ 
 
0 
 
 
MICXBOX4GBKINBUNDL 
 
0 
 
 
XBOXTV 
 
0 
 
 
XBOXPLUSTV22 
 
0 
 
 
MICXBOX3604GBBUNDLE 
 
0 
 
 
MICXBOX3604GB 
 
0 
 
 
MICXBOX360250GB 
 
0 
 
 
KITVISORLITEGOCKBT 
 
0 
 
 
CPWUNIVHOLCHARGER 
 
0 
 
 
TRENDMICROINTSECUR10 
 
0 
 
 
TOSNB200BROWN 
 
0 
 
 
TOSLV40TV 
 
0 
 
 
TOSLE32TV 
 
0 
 
 
TOSKV22TV 
 
0 
 
 
SONVAIOE2E1E 
 
0 
 
 
PSPGO 
 
0 
 
 
PS3ANDMOVESP 
 
0 
 
 
PS3PLUSTV 
 
0 
 
 
PS3MOVESP 
 
0 
 
 
SONYPS3SLIM 
 
0 
 
 
SCSMOKINBUDSBLA 
 
0 
 
 
SANCRUZERRETAIL8GB 
 
0 
 
 
SAMSUNGGALAXYTAB 
 
0 
 
 
OFNINTENDOWIIRESORT 
 
0 
 
 
WIIPLUSWIIFITPLUSBUNDLE 
 
0 
 
 
WIIPLUSTV 
 
0 
 
 
2XNINTENDODSIBLA 
 
0 
 
 
NINTENDODSIBLA 
 
0 
 
 
NOTEBOOKSLIMCASEBLKB 
 
0 
 
 
CLEMSIU135 
 
0 
 
 
LOGIM115MOUSE 
 
0 
 
 
LINKROUTERWRT160NUK 
 
0 
 
 
JAWBONEPRIMEBLA 
 
0 
 
 
HPMINI2101170 
 
0 
 
 
HPMINI110V2 
 
0 
 
 
HPG62A17SAV2 
 
0 
 
 
HANSN10E24RED 
 
0 
 
 
CLEDELINSP11Z  
 
0 
 
 
ASUX5DCV2 
 
0 
 
 
CLEASUUL30 
 
0 
 
 
ASUUL30 
 
0 
 
 
ALTECORBITSIL 
 
0 
 
 
CLEACE5335 
 
0 
 
 
CLEACER5315 
 
0 
 
 
 

Bellow is the code I used to parse the products ‘mobile_deals.xml’ file, this will produce a multidimensional array of phones with the correct key/pair values for each product. As a rough example:


array(
[0] => array(
[itemcode] => O2MIP3GS8B_EQ254FEB10_NA
)
)

The files are compressed in two formats either .zip (Zip) or .gz (Gzip), first it will download the gzip’d files and decompress them (should work on most linux systems) it will then try to parse them. The code is quite specefic and very rough so don’t expect it to work straight of the bat, this is just to give you a good idea and overview of how I did it.

 
 $url) 
{
	// Get file..
	$file = file_get_contents($url);
 
	if($file) {
		if(file_put_contents("uploads/$url_key.xml.gz",$file)) {
			$this->data->messages['success'] .= '

'.$url_key.' downloaded successfully

'; } else { $this->data->messages['error'] .= "

Failed to save the data feed $url_key

"; } } else { $this->data->messages['error'] .= "

Failed to get data feed $url_key

"; } } // Array list of xml files $xmls = array('mobile_deals', 'options', 'specialoffers', 'full_spec'); // Initiate logs $log = array(); foreach($xmls as $xml) { // de-compress and temporary store.. $gz = gzopen ("uploads/$xml.xml.gz", "r"); file_put_contents('addons/modules/phones/temp/tempfile.txt', $gz); gzclose($gz); // Only use this code for large XML's, currently only 'mobile_deals' if($xml == 'mobile_deals') { $allowed_tags = array("itemcode", "network", "make", "modelname", "tariff", "price", "monthly_line_rental", "free_minutes", "peak_landlines", "off_peak_landlines", "peak_same_network", "off_peak_same_network", "peak_diff_network", "off_peak_diff_network", "wap", "sms_same_network", "sms_diff_network", "peak_voice", "off_peak_voice", "inclusive_mins_info", "peak_times", "video_messaging", "mms", "giftdescription", "giftimageurl", "itemurl", "imageurl", "thumbnailurl", "handset_description", "bluetooth", "dualband", "triband", "gprs", "mp3", "radio", "camera", "colourscreen", "polyphonic", "vibralert", "voicedialling", "loudspeaker", "quadband", "highinsurance", "option", "tar_type_code", "specialoffercode1", "specialoffercode2", "free_sms", "offer_line_rental", "best_selling_tariff", "redemption_terms", "contract_duration", "offer_lr_duration", "caveat", "basecode", "picturemessaging", "category", "category_attr", "payg_handset_price", "payg_airtime_price", "payg_network", "payg_call_charges", "homepage", "colour", "style", "staticgift", "feature"); $bookList = array(); $optionList = array(); $staticgiftList = array(); $featureList = array(); $optionsTotal = array(); $i=0; $xmlReader = new XMLReader(); $xmlReader->open('addons/modules/phones/temp/tempfile.txt'); $count = 0; while($xmlReader->read()) { // check to ensure nodeType is an Element not attribute or #Text if($xmlReader->nodeType == XMLReader::ELEMENT) { if(in_array($xmlReader->localName, $allowed_tags)){ if($xmlReader->localName == 'option'){ $optionId = $xmlReader->value; $xmlReader->read(); $optionList[] = $xmlReader->value; //print_r($optionList);die(); } elseif($xmlReader->localName == 'staticgift') { $staticgiftId = $xmlReader->getAttribute('id'); while($xmlReader->read()) { if($xmlReader->nodeType == XMLReader::ELEMENT) { switch($xmlReader->localName) { case "plu": $xmlReader->read(); $staticgiftList[$staticgiftId]['plu'] = $xmlReader->value; break; case "desc": $xmlReader->read(); $staticgiftList[$staticgiftId]['desc'] = $xmlReader->value; break; case "cashback": $xmlReader->read(); $staticgiftList[$staticgiftId]['cashback'] = $xmlReader->value; break; default: break 2; } } } } elseif($xmlReader->localName == 'feature') { $featureId = $xmlReader->value; $xmlReader->read(); $featureList[] = $xmlReader->value; } else { $localName = $xmlReader->localName; // move to its textnode / child $xmlReader->read(); $bookList[$i][$localName] = $xmlReader->value; } } if($xmlReader->localName == 'product') { // Reset and append option list $bookList[$i]['option'] = $optionList; unset($optionList); $optionList = array(); // Reset and append staticgift list $bookList[$i]['staticgift'] = $staticgiftList; unset($staticgiftList); $staticgiftList = array(); // Reset and append feature list $bookList[$i]['featurelist'] = $featureList; unset($featureList); $featureList = array(); $i++; } } $count++; } } ?>

Unfortunately I came across some major problems with the XML file that is provided, one is that there are a few duplicate named elements which can lead to problems when it comes to coding the front end, and I found the parsing outcome sometimes did not always work 100% of the time, for example missing data for certain fields or data from one product bleeding into the next. I’m sure it could be fixed up in the code if I had more time, but it was hard to debug and I realised that there was a better way.

Recommended Way – e2save’s CSV Data Feed

I would recommend using the CSV as it is a lot easier to process, quicker and generally saves a lot of hasle, and its all pretty much down to MySQL.

It has a native function that allows you import CSV files straight into MySQL, without any processing in PHP. It’s incrediably fast, we are talking over 100x quicker than parsing the XML document with PHP, even with XML Reader and element by element. I can’t recommened it enough.

Bellow is the query I used + the data schema to help you get started

 
LOAD DATA LOCAL INFILE '/tmp/tempfile.csv' 
INTO TABLE e2_products
FIELDS TERMINATED BY ',' 
ENCLOSED BY '\"'
LINES TERMINATED BY '\r\n'
(itemcode, network, make, modelname, tariff, price, monthly_line_rental, free_minutes, peak_landlines, off_peak_landlines, peak_same_network, off_peak_same_network, peak_diff_network, off_peak_diff_network, wap, sms_same_network,  sms_diff_network, peak_voice, off_peak_voice, inclusive_mins_info, peak_times, video_messaging, mms, giftdescription, giftimageurl, itemurl, imageurl, thumbnailurl, handset_description, feature1, feature2, feature3, feature4, feature5, feature6, feature7, feature8, feature9, feature10, bluetooth, dualband, triband, wap, gprs, mp3, radio, camera, colourscreen, polyphonic, vibralert, voicedialling, loudspeaker, quadband, highinsurance, option1, option2, option3, option4, option5, option6, option7, option8, option9, option10, tar_type_code, freeb1, freeb2, freeb3, freeb4, freeb5, freeb6, freeb7, freeb8, specialoffercode1, specialoffercode2, free_sms, offer_line_rental, best_selling_tariff, redemption_terms, contract_duration, offer_lr_duration, caveat, basecode, picturemessaging, category, payg_handset_price, payg_airtime_price, payg_network, payg_call_charges, homepage, category1, category2, category3, category4, category5, category6, category7, category8, category9, category10, colour, style, giftcode1, giftdesc1, cashback1, giftcode2, giftdesc2, cashback2, giftcode3, giftdesc3, cashback3, giftcode4, giftdesc4, cashback4, giftcode5, giftdesc5, cashback5, giftcode6, giftdesc6, cashback6, giftcode7, giftdesc7, cashback7, giftcode8, giftdesc8, cashback8, giftcode9, giftdesc9, cashback9, giftcode10,  giftdesc10, cashback10, giftcode11, giftdesc11, cashback11, giftcode12, giftdesc12, cashback12, giftcode13, giftdesc13, cashback13, giftcode14,  giftdesc14, cashback14, giftcode15,  giftdesc15, cashback15, giftcode16, giftdesc16, cashback16, giftcode17, giftdesc17, cashback17, giftcode18, giftdesc18, cashback18, giftcode19, giftdesc19,  cashback19, giftcode20, giftdesc20, cashback20, giftcode21, giftdesc21, cashback21, giftcode22, giftdesc22, cashback22, giftcode23, giftdesc23, cashback23, giftcode24, giftdesc24, cashback24, giftcode25, giftdesc25, cashback25, giftcode26, giftdesc26, cashback26, giftcode27, giftdesc27, cashback27, giftcode28, giftdesc28, cashback28, giftcode29, giftdesc29, cashback29, giftcode30,  giftdesc30, cashback30, giftcode31, giftdesc31, cashback31, giftcode32, giftdesc32, cashback32, giftcode33, giftdesc33, cashback33, giftcode34,  giftdesc34, cashback34, giftcode35,  giftdesc35, cashback35, giftcode36, giftdesc36, cashback36, giftcode37, giftdesc37, cashback37, giftcode38, giftdesc38, cashback38, giftcode39, giftdesc39,  cashback39, giftcode40, giftdesc40, cashback40, giftcode41, giftdesc41, cashback41, giftcode42, giftdesc42, cashback42, giftcode43, giftdesc43, cashback43, giftcode44, giftdesc44, cashback44, giftcode45, giftdesc45, cashback45, giftcode46, giftdesc46, cashback46, giftcode47, giftdesc47, cashback47, giftcode48, giftdesc48, cashback48,    giftcode49, giftdesc49, cashback49, giftcode50, giftdesc50, cashback50, giftcode51, giftdesc51, cashback51, networkpayg)

SQL of a really rough table structure to store the data from a data feed csv.

 
-- phpMyAdmin SQL Dump
-- version 2.11.10
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 05, 2010 at 10:18 PM
-- Server version: 5.0.77
-- PHP Version: 5.1.6
 
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
 
--
-- Database: `example_database`
--
 
-- --------------------------------------------------------
 
--
-- Table structure for table `example_table`
--
 
CREATE TABLE IF NOT EXISTS `example_table` (
  `id` int(11) NOT NULL auto_increment,
  `itemcode` varchar(55) default NULL COMMENT 'A unique code for the deal. This code indicates the handset, tariff and gift.',
  `network` varchar(55) default NULL COMMENT 'Name of the network/category the offer is on',
  `make` varchar(55) default NULL COMMENT 'Handset make',
  `modelname` varchar(55) default NULL COMMENT 'Handset model name',
  `modelname_url` varchar(55) default NULL,
  `tariff` varchar(55) default NULL COMMENT 'The tariff the deal is on',
  `price` varchar(10) default NULL COMMENT 'Price of the handset',
  `monthly_line_rental` int(11) default NULL,
  `free_minutes` int(11) default NULL,
  `peak_landlines` int(11) default NULL,
  `off_peak_landlines` int(11) default NULL,
  `peak_same_network` int(11) default NULL,
  `off_peak_same_network` int(11) default NULL,
  `peak_diff_network` int(11) default NULL,
  `off_peak_diff_network` int(11) default NULL,
  `wap` varchar(10) default NULL,
  `sms_same_network` int(11) default NULL,
  `sms_diff_network` int(11) default NULL,
  `peak_voice` int(11) default NULL,
  `off_peak_voice` int(11) default NULL,
  `inclusive_mins_info` varchar(255) default NULL,
  `peak_times` varchar(255) default NULL,
  `video_messaging` varchar(255) default NULL,
  `mms` varchar(255) default NULL,
  `giftdescription` longtext COMMENT 'Description of free gift with offer',
  `giftimageurl` varchar(255) default NULL COMMENT 'URL of image of gift. You will need to replace WHITELABELCODE with your username',
  `itemurl` varchar(255) default NULL COMMENT 'blank',
  `imageurl` varchar(255) default NULL COMMENT 'URL of image of handset. You will need to replace WHITELABELCODE with your username',
  `thumbnailurl` varchar(255) default NULL COMMENT 'URL of thumbnail image of handset. You will need to replace WHITELABELCODE with your username',
  `handset_description` longtext,
  `feature1` varchar(255) default NULL,
  `feature2` varchar(255) default NULL,
  `feature3` varchar(255) default NULL,
  `feature4` varchar(255) default NULL,
  `feature5` varchar(255) default NULL,
  `feature6` varchar(255) default NULL,
  `feature7` varchar(255) default NULL,
  `feature8` varchar(255) default NULL,
  `feature9` varchar(255) default NULL,
  `feature10` varchar(255) default NULL,
  `bluetooth` varchar(10) default NULL,
  `dualband` varchar(10) default NULL,
  `triband` varchar(10) default NULL,
  `gprs` varchar(10) default NULL,
  `mp3` varchar(10) default NULL,
  `radio` varchar(10) default NULL,
  `camera` varchar(10) default NULL,
  `colourscreen` varchar(10) default NULL,
  `polyphonic` varchar(10) default NULL,
  `vibralert` varchar(10) default NULL,
  `voicedialling` varchar(10) default NULL,
  `loudspeaker` varchar(10) default NULL,
  `quadband` varchar(10) default NULL,
  `highinsurance` varchar(10) default NULL,
  `option1` varchar(255) default NULL COMMENT 'Code of option available with this offer. To be cross-referenced with CODE in options_datafeed.csv file',
  `option2` varchar(255) default NULL COMMENT 'Code of option available with this offer. To be cross-referenced with options_datafeed.csv file',
  `option3` varchar(255) default NULL COMMENT 'Code of option available with this offer. To be cross-referenced with options_datafeed.csv file',
  `option4` varchar(255) default NULL COMMENT 'Code of option available with this offer. To be cross-referenced with options_datafeed.csv file',
  `option5` varchar(255) default NULL COMMENT 'Code of option available with this offer. To be cross-referenced with options_datafeed.csv file',
  `option6` varchar(255) default NULL COMMENT 'Code of option available with this offer. To be cross-referenced with options_datafeed.csv file',
  `option7` varchar(255) default NULL COMMENT 'Code of option available with this offer. To be cross-referenced with options_datafeed.csv file',
  `option8` varchar(255) default NULL COMMENT 'Code of option available with this offer. To be cross-referenced with options_datafeed.csv file',
  `option9` varchar(255) default NULL COMMENT 'Code of option available with this offer. To be cross-referenced with options_datafeed.csv file',
  `option10` varchar(255) default NULL COMMENT 'Code of option available with this offer. To be cross-referenced with options_datafeed.csv file',
  `tar_type_code` varchar(255) default NULL COMMENT 'Code indicating tariff type',
  `freeb1` varchar(70) default NULL,
  `freeb2` varchar(70) default NULL,
  `freeb3` varchar(70) default NULL,
  `freeb4` varchar(70) default NULL,
  `freeb5` varchar(70) default NULL,
  `freeb6` varchar(70) default NULL,
  `freeb7` varchar(70) default NULL,
  `freeb8` varchar(70) default NULL,
  `specialoffercode1` varchar(255) default NULL COMMENT 'Code of special offer. To be cross-referenced with specialoffers_datafeed.csv file',
  `specialoffercode2` varchar(255) default NULL COMMENT 'Code of special offer. To be cross-referenced with specialoffers_datafeed.csv file',
  `free_sms` varchar(255) default NULL,
  `offer_line_rental` varchar(255) default NULL,
  `best_selling_tariff` varchar(255) default NULL,
  `redemption_terms` longtext,
  `contract_duration` varchar(255) default NULL,
  `offer_lr_duration` varchar(255) default NULL,
  `caveat` longtext,
  `basecode` varchar(255) default NULL,
  `picturemessaging` varchar(255) default NULL,
  `category` varchar(255) default NULL COMMENT 'Offer Category (network name)',
  `payg_handset_price` varchar(255) default NULL,
  `payg_airtime_price` varchar(255) default NULL,
  `payg_network` varchar(255) default NULL,
  `payg_call_charges` varchar(255) default NULL,
  `homepage` varchar(55) default NULL,
  `category1` varchar(55) default NULL,
  `category2` varchar(55) default NULL,
  `category3` varchar(55) default NULL,
  `category4` varchar(55) default NULL,
  `category5` varchar(55) default NULL,
  `category6` varchar(55) default NULL,
  `category7` varchar(55) default NULL,
  `category8` varchar(55) default NULL,
  `category9` varchar(55) default NULL,
  `category10` varchar(55) default NULL,
  `colour` varchar(55) default NULL,
  `style` varchar(55) default NULL,
  `giftcode1` varchar(60) default NULL COMMENT 'The code for the gift available with this product',
  `giftdesc1` varchar(60) default NULL COMMENT 'The description of the gift and cashback avaialable',
  `cashback1` varchar(60) default NULL COMMENT 'The cashback available with this gift',
  `giftcode2` varchar(60) default NULL,
  `giftdesc2` varchar(60) default NULL,
  `cashback2` varchar(60) default NULL,
  `giftcode3` varchar(60) default NULL,
  `giftdesc3` varchar(60) default NULL,
  `cashback3` varchar(60) default NULL,
  `giftcode4` varchar(60) default NULL,
  `giftdesc4` varchar(60) default NULL,
  `cashback4` varchar(60) default NULL,
  `giftcode5` varchar(60) default NULL,
  `giftdesc5` varchar(60) default NULL,
  `cashback5` varchar(60) default NULL,
  `giftcode6` varchar(60) default NULL,
  `giftdesc6` varchar(60) default NULL,
  `cashback6` varchar(60) default NULL,
  `giftcode7` varchar(60) default NULL,
  `giftdesc7` varchar(60) default NULL,
  `cashback7` varchar(60) default NULL,
  `giftcode8` varchar(60) default NULL,
  `giftdesc8` varchar(60) default NULL,
  `cashback8` varchar(60) default NULL,
  `giftcode9` varchar(60) default NULL,
  `giftdesc9` varchar(60) default NULL,
  `cashback9` varchar(60) default NULL,
  `giftcode10` varchar(60) default NULL,
  `giftdesc10` varchar(60) default NULL,
  `cashback10` varchar(60) default NULL,
  `giftcode11` varchar(60) default NULL,
  `giftdesc11` varchar(60) default NULL,
  `cashback11` varchar(60) default NULL,
  `giftcode12` varchar(60) default NULL,
  `giftdesc12` varchar(60) default NULL,
  `cashback12` varchar(60) default NULL,
  `giftcode13` varchar(60) default NULL,
  `giftdesc13` varchar(60) default NULL,
  `cashback13` varchar(60) default NULL,
  `giftcode14` varchar(60) default NULL,
  `giftdesc14` varchar(60) default NULL,
  `cashback14` varchar(60) default NULL,
  `giftcode15` varchar(60) default NULL,
  `giftdesc15` varchar(60) default NULL,
  `cashback15` varchar(60) default NULL,
  `giftcode16` varchar(60) default NULL,
  `giftdesc16` varchar(60) default NULL,
  `cashback16` varchar(60) default NULL,
  `giftcode17` varchar(60) default NULL,
  `giftdesc17` varchar(60) default NULL,
  `cashback17` varchar(60) default NULL,
  `giftcode18` varchar(60) default NULL,
  `giftdesc18` varchar(60) default NULL,
  `cashback18` varchar(60) default NULL,
  `giftcode19` varchar(60) default NULL,
  `giftdesc19` varchar(60) default NULL,
  `cashback19` varchar(60) default NULL,
  `giftcode20` varchar(60) default NULL,
  `giftdesc20` varchar(60) default NULL,
  `cashback20` varchar(60) default NULL,
  `giftcode21` varchar(35) default NULL,
  `giftdesc21` varchar(35) default NULL,
  `cashback21` varchar(35) default NULL,
  `giftcode22` varchar(35) default NULL,
  `giftdesc22` varchar(35) default NULL,
  `cashback22` varchar(35) default NULL,
  `giftcode23` varchar(35) default NULL,
  `giftdesc23` varchar(35) default NULL,
  `cashback23` varchar(35) default NULL,
  `giftcode24` varchar(35) default NULL,
  `giftdesc24` varchar(35) default NULL,
  `cashback24` varchar(35) default NULL,
  `giftcode25` varchar(35) default NULL,
  `giftdesc25` varchar(35) default NULL,
  `cashback25` varchar(35) default NULL,
  `giftcode26` varchar(35) default NULL,
  `giftdesc26` varchar(35) default NULL,
  `cashback26` varchar(35) default NULL,
  `giftcode27` varchar(35) default NULL,
  `giftdesc27` varchar(35) default NULL,
  `cashback27` varchar(35) default NULL,
  `giftcode28` varchar(35) default NULL,
  `giftdesc28` varchar(35) default NULL,
  `cashback28` varchar(35) default NULL,
  `giftcode29` varchar(35) default NULL,
  `giftdesc29` varchar(35) default NULL,
  `cashback29` varchar(35) default NULL,
  `giftcode30` varchar(35) default NULL,
  `giftdesc30` varchar(35) default NULL,
  `cashback30` varchar(35) default NULL,
  `giftcode31` varchar(35) default NULL,
  `giftdesc31` varchar(35) default NULL,
  `cashback31` varchar(35) default NULL,
  `giftcode32` varchar(35) default NULL,
  `giftdesc32` varchar(35) default NULL,
  `cashback32` varchar(35) default NULL,
  `giftcode33` varchar(35) default NULL,
  `giftdesc33` varchar(35) default NULL,
  `cashback33` varchar(35) default NULL,
  `giftcode34` varchar(35) default NULL,
  `giftdesc34` varchar(35) default NULL,
  `cashback34` varchar(35) default NULL,
  `giftcode35` varchar(35) default NULL,
  `giftdesc35` varchar(35) default NULL,
  `cashback35` varchar(35) default NULL,
  `giftcode36` varchar(35) default NULL,
  `giftdesc36` varchar(35) default NULL,
  `cashback36` varchar(35) default NULL,
  `giftcode37` varchar(35) default NULL,
  `giftdesc37` varchar(35) default NULL,
  `cashback37` varchar(35) default NULL,
  `giftcode38` varchar(35) default NULL,
  `giftdesc38` varchar(35) default NULL,
  `cashback38` varchar(35) default NULL,
  `giftcode39` varchar(35) default NULL,
  `giftdesc39` varchar(35) default NULL,
  `cashback39` varchar(35) default NULL,
  `giftcode40` varchar(35) default NULL,
  `giftdesc40` varchar(35) default NULL,
  `cashback40` varchar(35) default NULL,
  `giftcode41` varchar(35) default NULL,
  `giftdesc41` varchar(35) default NULL,
  `cashback41` varchar(35) default NULL,
  `giftcode42` varchar(35) default NULL,
  `giftdesc42` varchar(35) default NULL,
  `cashback42` varchar(35) default NULL,
  `giftcode43` varchar(35) default NULL,
  `giftdesc43` varchar(35) default NULL,
  `cashback43` varchar(35) default NULL,
  `giftcode44` varchar(35) default NULL,
  `giftdesc44` varchar(35) default NULL,
  `cashback44` varchar(35) default NULL,
  `giftcode45` varchar(35) default NULL,
  `giftdesc45` varchar(35) default NULL,
  `cashback45` varchar(35) default NULL,
  `giftcode46` varchar(35) default NULL,
  `giftdesc46` varchar(35) default NULL,
  `cashback46` varchar(35) default NULL,
  `giftcode47` varchar(35) default NULL,
  `giftdesc47` varchar(35) default NULL,
  `cashback47` varchar(35) default NULL,
  `giftcode48` varchar(35) default NULL,
  `giftdesc48` varchar(35) default NULL,
  `cashback48` varchar(35) default NULL,
  `giftcode49` varchar(35) default NULL,
  `giftdesc49` varchar(35) default NULL,
  `cashback49` varchar(35) default NULL,
  `giftcode50` varchar(35) default NULL,
  `giftdesc50` varchar(35) default NULL,
  `cashback50` varchar(35) default NULL,
  `giftcode51` varchar(35) default NULL,
  `giftdesc51` varchar(35) default NULL,
  `cashback51` varchar(35) default NULL,
  `networkpayg` varchar(55) default NULL,
  `modified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=12786 ;

Leave a Reply