Gossamer Forum
Home : General : Internet Technologies :

Print labels from database.

Quote Reply
Print labels from database.
Hi,

I have developed a MySQL database on a windows network, with a PHP interface. When people call up the company, they are entered into this database. A newsletter is sent out every couple of months. We want to print people's addresses from this database onto avery labels (L7162 format to be exact). Ideally, an HTML interface for doing this would be great - so people could print labels directly from the PHP interface.

Otherwise, a freeware program which can connect through ODBC to the MySQL database, and allow us to query it, and print from that onto the labels, would be needed. I have tried doing this through MS Word, and it doesn't work well at all. I can do it through MS Excel, and then save that, and open the saved Excel file in word, and do the labels and it works, but that is a hassle.

Any advice on this would be greatly appreciated!

Thank you,

Michael Bray

Last edited by:

Michael_Bray: Dec 20, 2004, 6:50 PM
Quote Reply
Re: [Michael_Bray] Print labels from database. In reply to
Can you set up some kind of Export function?

We do something similar, but I don't use SQL - (dbman flat file to be exact) - instead I use CGI/Perl however the concept is the same.

What we do is:

1. "export" the data to a text file called labels.txt in a comma delimited format using Perl (to open and write the file and email it to us as an attachment)

2. We have a Word mail-merge called set up that it looks for a data/text file called "labels.txt" as part of the merge. (the labels.txt file gets overwritten each time)

3. And then merge the labels and print them.

It's really less hassle than it sounds - go to website, click button, retrieve email, save attachment, double click on merge doc, print labels

The whole thing can be done in less than 2 minutes.

Hope this helps somewhat....
Quote Reply
Re: [Michael_Bray] Print labels from database. In reply to
Or just make the script spit out some html that's sized correctly to print right out. You might have to experiment to get the page sizing correct though.

Adrian
Quote Reply
Re: [brewt] Print labels from database. In reply to
Getting the output of the HTML to match would be extremly hard when you are printing 40,000 labels. You only have to be a fraction of a millimetre out, and it catches up and prints everywhere after a while.

Exporting would be easy, but at the company I developed the database for, no one is computer literate. I wanted a really easy solution. I am going to have to code up an easy export option I guess.
Cheers,
Michael Bray
Quote Reply
Re: [Michael_Bray] Print labels from database. In reply to
40,000 labels is quite a run... We used to use the Avery labels (cont form) but I don't remember the number. We had a couple of high speed TI dot-matrix printers and I learned how to "hook together" a couple of boxes of the labels so they could run for an hour or two non-stop.

Ah... the good old days.

(Now we just import the list into the PB AddressRight system and print directly on the mail)