Hi I am trying to stream 900 + rows from my MySQL db it works on lesser amounts
Any ideas / alternatives to acheive this ?
<?php
// Here we tell the browser that this is an excel file.
header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=sellfones-".date("Y-m-d").".csv");
header("Pragma: no-cache");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Expires: 0");
//Variables to connect to MySQL database
error_reporting (E_ALL);
$user = "xxxxxx"; //MySQL Username
$password = "xxxxxx"; // MySQL Usernames Password
$dbname= "xxxxxx"; //Database Name
$tablename ="fone_e2save_products"; // DB Table Name
$server="localhost"; //MySQL server name
$global_dbh = mysql_connect($server, $user, $password); // This establishes the database connection
mysql_select_db($dbname, $global_dbh); // Select what database to use
// You do not need to change the function
echo "product_id, 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_cost, 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_set,
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, Buy_URL, category, CONTRACT_DURATION, OFFER_LR_DURATION\n";
$query = mysql_query("SELECT fone_e2save_products_id, 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_set,
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, category, CONTRACT_DURATION, OFFER_LR_DURATION FROM $tablename");
while($row = mysql_fetch_array($query)){
$buyURL = "http://www.sellfones.net/fone_options.php?products_id=$row[itemcode]&option_network_select=15";
echo "$row[fone_e2save_products_id],
$row[itemcode],
$row[network],
$row[make],
$row[modelname],
$row[tariff],
$row[price],
$row[monthly_line_rental],
$row[free_minutes],
$row[peak_landlines],
$row[off_peak_landlines],
$row[peak_same_network],
$row[off_peak_same_network],
$row[peak_diff_network],
$row[off_peak_diff_network],
$row[wap],
$row[sms_same_network],
$row[sms_diff_network],
$row[peak_voice],
$row[off_peak_voice],
$row[inclusive_mins_info],
$row[peak_times],
$row[video_messaging],
$row[mms],
$row[giftdescription],
$row[giftimageurl],
$row[itemurl],
$row[imageurl],
$row[thumbnailurl],
$row[handset_description],
$row[feature1],
$row[feature2],
$row[feature3],
$row[feature4],
$row[feature5],
$row[feature6],
$row[feature7],
$row[feature8],
$row[feature9],
$row[feature10],
$row[bluetooth],
$row[dualband],
$row[triband],
$row[wap_set],
$row[gprs],
$row[mp3],
$row[radio],
$row[camera],
$row[colourscreen],
$row[polyphonic],
$row[vibralert],
$row[voicedialling],
$row[loudspeaker],
$row[quadband],
$row[highinsurance],
$row[option1],
$row[option2],
$row[option3],
$row[option4],
$row[option5],
$row[option6],
$row[option7],
$row[option8],
$row[option9],
$row[option10],
$row[TAR_TYPE_CODE],
$row[FREEB1],
$row[FREEB2],
$row[FREEB3],
$row[FREEB4],
$row[FREEB5],
$row[FREEB6],
$row[FREEB7],
$row[FREEB8],
$row[SPECIALOFFERCODE1],
$row[SPECIALOFFERCODE2],
$row[FREE_SMS],
$row[OFFER_LINE_RENTAL],
$row[BEST_SELLING_TARIFF],
$row[REDEMPTION_TERMS],
$buyURL,
$row[category],
$row[CONTRACT_DURATION],
$row[OFFER_LR_DURATION]\n";
}
?>