Author Topic: Data from mysql to a pdf file, using a php script  (Read 4562 times)

0 Members and 1 Guest are viewing this topic.

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Data from mysql to a pdf file, using a php script
« on: March 12, 2009, 01:53:14 PM »
I have a mysql database where I store information from VWS using VWSql, and now I wonder if there is any way to collect any information from the database using a php script to create a pdf file?

I'm going to have a page where you can choose what you want for information in the file, like period of time (from - to), wind, rain, temperature, etc., etc.

anyone know where I can find such a script?

(I am not quite sure that this is the right place for this question, if not please move it to the right place)
Lars Magnusson
Axelvold / Sweden
55° 57' 41" N / 13° 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9015
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Data from mysql to a pdf file, using a php script
« Reply #1 on: March 12, 2009, 02:55:39 PM »
PHP does have a library to create PDF files, but I am not sure that all PHP installations have that library installed.  It looks like your script would have 3 parts:

1) display selection form for information requested
2) retrieve the selected information from your mySQL database
3) format the selected information and print output to a new PDF file for viewing

I've not seen a script for that shared from other developers (and I've not really used much SQL) so I'm of little help here :)

I suggest you work on (1) and (2) with the output presented on the returned webpage, and when that is functional to your satisfaction, then work on adding (3) as an output option for the viewer. 

Personally, I prefer to view websites (and queries to websites) in HTML as it is much faster to load and lower overhead.  PDF is used to retain presentation fidelity across online and print, and should only be used where a typographical format must be preserved, otherwise HTML presentation is prefered.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: Data from mysql to a pdf file, using a php script
« Reply #2 on: March 12, 2009, 03:25:09 PM »
Thanks Ken, I will check this right away.
Lars Magnusson
Axelvold / Sweden
55° 57' 41" N / 13° 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline Bushman

  • Forecaster
  • *****
  • Posts: 7549
    • Eagle Bay Weather
Re: Data from mysql to a pdf file, using a php script
« Reply #3 on: March 12, 2009, 03:49:47 PM »
Here's an example of php form-based selection in front of MySQL.  http://shuswaplakewatch.com/php/datasheet.php  Output to pdf is a POC using client based SW.  There are tons of php-based PDF generators BTW.  Like FPDF.
Need low cost IP monitoring?  http://wirelesstag.net/wta.aspx?link=NisJxz6FhUa4V67/cwCRWA or PM me for 50% off Wirelesstags!!

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: Data from mysql to a pdf file, using a php script
« Reply #4 on: March 12, 2009, 04:19:08 PM »
Here's an example of php form-based selection in front of MySQL.  http://shuswaplakewatch.com/php/datasheet.php  Output to pdf is a POC using client based SW.  There are tons of php-based PDF generators BTW.  Like FPDF.

Thanks Bushman

I will check those pages
Lars Magnusson
Axelvold / Sweden
55° 57' 41" N / 13° 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: Data from mysql to a pdf file, using a php script
« Reply #5 on: March 12, 2009, 06:20:48 PM »
anyone know a good php script that can retrieve data from a mysql database?
Lars Magnusson
Axelvold / Sweden
55° 57' 41" N / 13° 6' 1" E
WX Station: Davis Vantage Pro2 Plus