Looks like that site is on a PHP 4.4.8/mysql 4.1.22 server.
Just gave that query one more try through Navicat, and the column I’m trying to format returns “[Null]”.
SELECT entry_date,
date_format(entry_date, '%c/%e/%Y') AS formatted_date,
email
FROM exp_freeform_entries
ORDER BY entry_date DESC
resulted in:
1225305383 [Null] email@address1.com
1225301519 [Null] email@address2.com
1218244116 [Null] email@address3.com
1217824199 [Null] email@address4.com
My other thought was to target the entry_date field and use PHP date() to format that field right in the plugin, but it doesn’t seem like should have to go there.
Daniel - I have a SQL statement that will return results when run directly against the DB (in phpMyAdmin), but when I use your plug-in, nothing is downloaded. This is the only thing on the template, so it’s something in your plug-in it would seem? I can’t figure it out - I’ve been looking at the plug-in and I can’t see any reason this wouldn’t work:
{exp:csvee query="SELECT
company_uid,
FROM_UNIXTIME(entry_date, '%m/%d/%Y') AS `date`,
company,
last_name,
first_name,
title,
address,
address_2,
city,
state,
county,
zip,
phone,
fax,
email,
url,
contact_control,
business_description,
employees,
category,
member_discount,
options,
membership_level,
REPLACE(donation, 'Other:', '') AS donation,
donation_amount,
'CC' AS `payment type`,
approval_num,
tags,
member_to_member_communication,
password,
subscription_id AS `notes`
FROM exp_freeform_entries
WHERE form_name = 'update_info_form'
ORDER BY entry_date
DESC"
filename="update_submissions.csv"}
I have two other export templates that use that exact same code and just changes the “WHERE” clause, and they both work as well. Any thoughts? Could there be something in the results themselves that could be somehow tripping up the generation of the CSV?
Thanks…
Edit - I’m still trying to track down exactly what’s going on, but it probably isn’t your extension. There’s a few other weird things happening
It does bring up another thing I was going to say though. I’ve used this plug-in a few times and it’s great. A feature I’d find really useful would be a debug option - if your SQL throws an error or something doesn’t work, you could get the SQL statement itself and the MySQL error response. Just a thought - I tend to need to debug my SQL statements and have to use another tool to see what actually happens if it’s not a good query.
Daniel - something else happens during CSV formation that was causing a Filemaker consultant to pull her hair out. It adds an extra line at the beginning and end of the CSV. I modified (just for myself) the plug-in so it didn’t include a carrage return on the end, but didn’t quickly see where the beginning extra line was coming from (and it seemed like it wasn’t always there?).
Just thought I would mention it (I’m sure you’re just waiting around for things to do to this plug-in!)
I have the following SQL Query which is pulling information from the database (the simple commerce module table specifically) and I need to export it to a CSV file. Currently it generates a text web page.
{exp:query sql="SELECT c.item_id, purchase_date, item_cost, paypal_details, entry_id, txn_id FROM
exp_simple_commerce_purchases c, exp_simple_commerce_items e
WHERE e.item_id = c.item_id"}
{exp:weblog:entries weblog="misc_content" entry_id="{entry_id}" dynamic="off"}
<strong>{title}</strong>
{exp:paypal_details details="first_name"}{paypal_details}{/exp:paypal_details} {exp:paypal_details details="last_name"}{paypal_details}{/exp:paypal_details}
{exp:paypal_details details="address_street"}{paypal_details}{/exp:paypal_details}
{exp:paypal_details details="address_city"}{paypal_details}{/exp:paypal_details} {exp:paypal_details details="address_state"}{paypal_details}{/exp:paypal_details} {exp:paypal_details details="address_zip"}{paypal_details}{/exp:paypal_details} {exp:paypal_details details="address_country"}{paypal_details}{/exp:paypal_details}
{/exp:weblog:entries}
Date of Sale: <strong>{purchase_date format="%d %M %Y"}</strong>
<hr >
{if no_results}
They have made no purchases
{/if}
{/exp:query}
Is this possible with the CSVee plugin? I used CSVee to pull the data itself - which was easy, great plugin - but I couldn’t figure out how to unserialize the data to extract only what I need.
Any suggestions or guidance would be great!
Thanks, Brad Hopkins
I’m using this plugin to export a CSV of some weblog data. It works great, minus one problem, it doesn’t seem to want to keep the characters I have in front of some of my strings. In my case it’s this one: ± in front of numbers. It seems to just output the numbers.
Sure that isn’t just excel being… well, excel? (opened the file in notepad to verify?)
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.