osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

How do I export data to csv file?

This is a discussion on How do I export data to csv file? within the osCMax v1.7 General Mods Discussion forums, part of the osCMax v1.7 Forums category; We want to export Welcome to BeSeenOnAbike products to a csv file. http://www.oscmax.com/forums/new-osc...port-file.html Can someone describe how to do this?...



Find us on Facebook
Go Back   osCommerce and osCMax shopping cart software forums > osCMax v1.7 Forums > osCMax v1.7 General Mods Discussion

Connect with Facebook Register FAQDonate Members List Calendar Mark Forums Read


Closed Thread

 

LinkBack Thread Tools
  #1  
Old 10-13-2008, 06:34 AM
New Member
 
Join Date: May 2005
Location: UK
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
cstreet
Default How do I export data to csv file?

We want to export Welcome to BeSeenOnAbike products to a csv file.

Product Info Export File

Can someone describe how to do this?

Last edited by michael_s; 10-13-2008 at 07:28 AM. Reason: inappropriate commercial request
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #2  
Old 10-13-2008, 06:01 PM
jpf's Avatar
jpf jpf is offline
Moderator

 
Join Date: Sep 2003
Location: Manitoba, Canada
Posts: 2,681
Thanks: 12
Thanked 214 Times in 196 Posts
Rep Power: 20
jpf has much to be proud ofjpf has much to be proud ofjpf has much to be proud ofjpf has much to be proud ofjpf has much to be proud ofjpf has much to be proud ofjpf has much to be proud ofjpf has much to be proud ofjpf has much to be proud of
Default Re: How do I export data to csv file?

You host's phpMyAdmin panel does have a export to CVS.

Supports:
CSV
CSV for MS Excel
Microsoft Excel 2000
Microsoft Word 2000
LaTeX
Open Document Spreadsheet
Open Document Text
PDF
SQL
XML

However only support IMPORTING as
SQL compatibility mode:
NONE
ANSI
DB2
MAXDB
MYSQL323


Chose your a specific table or the whole database - for a one time thing great.

If your looking at "Product Info Export Files" this is not included as a default but can be added easily - this is for export only.

As well as there is Easy Populate - already included in osCMax - support export and importing as well.
__________________
JPF - osCMax Fourm Moderator - To contact, post on the forum or click here
Try out our osCMax at: Live Catalog Demo
Limited access Admin: Live Admin Demo
Feel free to add products they way you want and then purchase them -=+=- Sorry nothing will be billed or shipped!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
The Following User Says Thank You to jpf For This Useful Post:
cstreet (10-15-2008)
  #3  
Old 10-15-2008, 07:33 AM
New Member
 
Join Date: May 2005
Location: UK
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
cstreet
Default Re: How do I export data to csv file?

Thanks very much. I'm going to try to use Easy Populate first.

Chris Street
Welcome to BeSeenOnAbike
DataMind Home page
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #4  
Old 03-01-2009, 03:22 AM
Active Member
 
Join Date: Jun 2008
Posts: 184
Thanks: 17
Thanked 3 Times in 3 Posts
Rep Power: 2
trochia is on a distinguished road
Thumbs up Re: How do I export data to csv file?

This will export to csv your products into the file you would like. But if you have any NULL (emptydata) in the fields, you'll get misplacement...but it also calls attention to any input, that was missed...that you may correct. Either via osCMax, or faster using phpMyAdmin as Michael mentioned.

Once corrected (missing entries), you may then select individual fields, instead of *

PHP Code:
<?php
$host 
'localhost'// use URL if external server
$user 'dbUserName'// Change me
$pass 'dbPassword; //Change me
$db = '
dbName'; // Change me
$table = '
products';
$file = '
export';
$link = mysql_connect($host, $user, $pass) or die("Can not connect." . mysql_error());
mysql_select_db($db) or die("Can not connect.");
$result = mysql_query("SHOW COLUMNS FROM ".$table."");
$i = 0;
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
$csv_output .= $row['
Field]."; ";
$i++;
}
}
$csv_output .= "n";
$values mysql_query("SELECT * FROM ".$table."");
while (
$rowr mysql_fetch_row($values)) {
for (
$j=0;$j<$i;$j++) {
$csv_output .= $rowr[$j]."; ";
}
$csv_output .= "n";
}
$filename $file."_".date("Y-m-d_H-i",time());
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: csv" date("Y-m-d") . ".csv");
header"Content-disposition: filename=".$filename.".csv");
print 
$csv_output;
exit;
?>
Hope this helps
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Export all order data to a csv file 1.0 michael_s New osCommerce Contributions 0 04-07-2008 04:24 PM
Export all order data to a csv file 1.0 michael_s New osCommerce Contributions 0 01-22-2008 09:11 AM
Export all order data to a csv file 1.0 michael_s New osCommerce Contributions 0 01-04-2008 03:12 PM
Export all order data to a csv file 1.0 michael_s New osCommerce Contributions 0 12-19-2007 03:30 PM
Export all order data to a csv file 1.0 michael_s New osCommerce Contributions 0 06-21-2007 04:00 AM


All times are GMT -8. The time now is 08:27 PM.


Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO
Copyright 2009 osCMax
Inactive Reminders By Icora Web Design