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)
// In memory file, no write to disk needed... just be careful with large amounts of data! $f = fopen('php://memory', 'w'); // Or... $f = fopen('php://output', 'w');
Been a long while since I did something like this with PDF files, so apologies if this is not perfect!
Speaking of which, this is the library I used for PDF generation which might work for your requirements: http://www.fpdf.org/
You must have MySQL client libraries installed on your computer. We recommend using the most current version of the v5.0 MySQL clients.
Connect to the MySQL server using the command:
mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A
The -A flag is optional but is recommended for speed.
Once connected to the database, you may use a wide range of MySQL commands to query the database.
Conditions of Use
Avoid excessive or heavy queries that may impact the server performance. Inappropriate query use will result in a restriction of access. If you plan to execute a query that you think may be excessive, contact UCSC first to avoid the possibility of having your access blocked. Bot access and excessive program-driven use are not permitted. Attachments by local mirror sites are prohibited.