Forums

Offloading Data

DaveNagy 17 Dec, 2014
Does Chronoform V5 include any utilities to let me offload MySQL data to a CSV-formatted file that can be downloaded by a user?

If not, is it possible to create an admin-level-only script that would call a PHP or JS program I create to do this? (That is, has anyone done this and what techniques did you use that would push me in one direction or another).

Thanks for anyone who can offer suggestions for this topic!

Dave
GreyHead 18 Dec, 2014
Hi DaveNagy,

There's an Export button on the View Data page (though that has some limitations at the moment); there's a CSV Export action built in that you can use (and another for Google Spreadsheets).

That said, for sites where I want occasional downloads I use the AceSQL or MijoSQL component where I can build a custom MySQL query, save it then run and export the results. (Though I suspect that there are some quoting problems if you use this with text area results.)

Bob
DaveNagy 18 Dec, 2014
Thanks, Bob! I'll look into those components.

I'm using Joomla! and ChronoForms (and other components and add-ins) to set up a demo for our non-profit group how we can control the content of our web site without relying or paying someone for every change.
DaveNagy 18 Dec, 2014
Downloaded AceSQL and it's a piece of junk. Try a simple query 'SELECT * FROM #FWST_RideRegistration LIMIT 10' and I get an 1064 (SQL Syntax error) - but the same query works in PHPMyAdmin. Click the 'Export to CSV' button and I get this error: "Firefox can't find the file at http://192.168.1.215/FWSTDemo/administrator/index.php?option=com_acesql". Go to their site to search for anyone else reporting this and get a token error trying to seach on 1064 (the MYSQL message number). Check out their other support options and I either have to pay or register just to report their software doesn't work.

I know you don't support them but I had to vent. Thanks for letting me do this.
GreyHead 19 Dec, 2014
Hi Dave,

It's not idea but has worked fine for me for several years now (MijoSQL is a clone so will have the same problems).

From a quick look #FWST_RideRegistration isn't a valid MySQL table name. Ace SQL will handle the Joomla! default prefix but that is #_ not just #

Try selecting the table name from the drop-down. If that really is the table name then you probably need to quote it with backticks `#FWST_RideRegistration`

Bob
DaveNagy 19 Dec, 2014
Bob,
THANKS!!! The backticks were the answer. This will let me build queries that I can document for our team to execute to extract the data as they see fit. It won't be as flexible as them selecting columns as they want but in some ways, it's better to reduce the flexibility in some instances.

Enjoy the coffee, beer, or book, as you desire. If our non-profit decides to move ahead with switching from a fully hosted implementation of our web site to controlling the content on our own, I may be coming back to you with more questions in the future. (BTW, have you visited 'http://www.freereadfeed.com' for your Kindle....I've found some great reads out there for no cost but also found quite a few duds but I've read quite a few new authors.)

Again, thanks!
Dave
DaveNagy 20 Dec, 2014
I also renamed the tables with PHPmyadmin to remove the '#', reconnected the newly-named tables to the 'save data' action on each form, and AceSQL didn't complain at all when I ran queries against them and successfully downloaded CSV files when I requested this. I just can't get AceSQL to save any queries so life is easier for our users.

BTW, when I create a table in Chronoform V5, the '#' is part of the suggested table name (ie, #__chronoengine_chronoforms_datatable_demo-multipage). I guessed this was suggested to keep the table at the top of the collating sequence when listing all of the tables so I kept it there. Alas....
GreyHead 20 Dec, 2014
Hi Dave,

As I tried to say in my earlier post Joomla! uses #_ as a 'placeholder' for the random string prefix that it adds to the core Joomla! tables. In Joomla! 1.5 they were all jos_some_name but, for security reasons, Joomla! 3 uses a random string set when you install Joomla! (you can over-ride and set your own there if you need to).

Using #_ means that you can write code that will find the users table by using #__users instead of having to set aaaa_users or zzzz_users and change the code for every site.

The usual style is to put an underscore after the prefix so you will see #__users, and the #_ is then replaced with the site specific prefix.

Bob

PS I have MijoSQL installed on my test site and was able to save a query using that with no problem. As far as I know it's more or less the same as AceSQL - maybe some minor updates. The only problem that I have found is that you can't add < or > in a query (and some very old versions had the 'Delete OK?' alert message in Cyrillic).
DaveNagy 25 Dec, 2014
I missed that comment about the placeholder - my error.

MijoSQL is working for me just fine and I think it'll work for now. If our users decide to move ahead with a Joomla!-based site and become more sophisticated in their data needs, I'll work on a more custom solution.

Take care and Thanks, again!
Dave
This topic is locked and no more replies can be posted.