i want to allow user to download query data from mySQL server (1 Viewer)

debywilliams

New member
Local time
Yesterday, 23:17
Joined
May 26, 2015
Messages
3
Hi, I have a non-profit website that I've developed with PHP. I'm trying to make the logged in users can output letters in Word with selected data from a query in MySQL. I've tried to use PHPWord, the letters outputted with no data in the letters. Also I tried used PHP COM, but Hostforlife won't let me restart the server because it is shared.
Lastly I wrote a SELECT query with INTO OUTFILE '$file' to create a CSV which the users could download and use to merge into Word, but because the database user does not have FILE access, it produces this error:

Error: Access denied for user 'blabla'@'localhost' (using password: YES)

I think Hostforlife will not allow FILE privileges on a shared server. So, how can I get around this. Somehow I want to be able to at least write the query and download the data. Javascript? jQuery? or Something else? Any of you can help me?

Thanks in advance
 

sneuberg

AWF VIP
Local time
Yesterday, 23:17
Joined
Oct 17, 2014
Messages
3,506
It sounds like the best solution would be a Word Macro that would retrieve the data and place it directly in the Word document but in order to do that you would need to set up an ODBC data source. Below is an image of a configuration on my PC. The thing to note is that it has a test button. So without to much effort you can determine if this approach is doable. If it is then you can query your data in a Word macro using a ADO connection. Let me know if you get that working and I'll see if I can give you some good links for learning ADO and Word Automation.


 

Attachments

  • ODBC Conf.png
    ODBC Conf.png
    45.8 KB · Views: 569

Rx_

Nothing In Moderation
Local time
Today, 00:17
Joined
Oct 22, 2009
Messages
2,803
Just a suggestion to evaluate:
https://azure.microsoft.com/en-us/documentation/articles/web-sites-php-mysql-deploy-use-ftp/

Last night, I attended the local Microsoft Azure Users Group meeting.
The new Azure interface release at least appears to be very improved over the previous version(s). The presentation was primarily about AD (Active Directory) and the security.
I am more jazzed about learning more about Azure for future projects.
As demo's go, the heavily experienced presenter showed the various interfaces at full speed. The takeaway is the ability to use Azure for multiple connections.

My current project is intranet SQL Server based so I don't have the time to look into your exact question. However, the link above (one of many out there) might provide some ideas about evaluating a free Azure account for your question.

My longer term goal is to learn more about Azure and provide administrative custom interfaces via MSAccess and administrative data mining with Excel Object Model Programming out of Azure.

Some of the users at the group expressed the new version reduced the complexity. In some cases, waiting for a better version can have its advantages.
 

Users who are viewing this thread

Top Bottom