Hi All I have some 60 employees data in my database and i want to generate reports for these employees on monthly basis in excel format using php . Will anybody help me , how to proceed.
@codebudoSep 20.2007 — #The easies thing to do is produce a file of comma separated values (CSV) and then import that into excel. If you really need to have excel formatting and multiple sheets and such, you'll need to use an excel generating php library. If this is just for your own use and with such a small number of employees, the CVS option is much easier.
@NogDogSep 20.2007 — #To add to the preceding reply, if you're running PHP 5 there is a [url=http://www.php.net/fputcsv]fputcsv() function[/url] which makes this fairly easy. All you need to do is read each row as an array with mysql_fetch_assoc() or mysql_fetch_row() (or comparable functions if using another DBMS), and output each row via the fputcsv() function.