LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-17-2016, 11:33 PM   #1
MeghanClaire
LQ Newbie
 
Registered: Jun 2015
Posts: 5

Rep: Reputation: Disabled
i want to allow user to download query data from mySQL server


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
 
Old 07-18-2016, 02:00 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
PHPWord is probably a good start. If there were not any data in the letters, then there were mistakes in your php script. Try again or hire a programmer to do the job.
Javascript is not needed for this.

set below in the PHP scripts you write

<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');

That will help to find the errors...

Cheers
j
 
Old 07-18-2016, 08:21 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,675

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by MeghanClaire View Post
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
I bolded the error above, in what you posted...did you understand that error?? The user you're specifying in the PHP file to connect to the database doesn't have permissions to that database, or you specified it incorrectly in your PHP file. Since you don't actually post the relevant parts of your PHP code that make this connection, we can't tell you which...read the "Question Guidelines" link in my posting signature.

Either create a user name that has read-only access to that database (more secure), or verify your connection credentials are correct.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Server Linux, CentOS VPS - Lost connection to MySQL server during query snooze1 Linux - Newbie 3 10-29-2011 03:01 AM
Error: Lost connection to MySQL server during query the expert Linux - Newbie 6 09-04-2008 12:40 PM
MySQL & user-submitted query hbar Linux - Server 4 03-08-2008 03:34 AM
Lost connection to MySQL server during query figure8car Mandriva 1 12-05-2004 04:28 PM
Error: lost connection to MySQL server during query patpawlowski Programming 2 01-23-2004 07:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration