Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

mailing labels from DB

Codes here !

Moderators: macek, egami, gesf

mailing labels from DB

Postby justin » Tue Oct 29, 2002 5:54 pm

hello,
I need to create i mySQL database for a client, one of the features that they want is to be able to log into the administration site, and print off mailing lables from the DB, so does any one know how i would go about doing this. I know that I can make the information display in tables , but is there any way I can export it to some .txt (page by page), or should i just use an access DB, and have them d/l it and do everything from access. The one problem is that this DB has the potential to hace tens of thousands of entries in it. Any ideas or wisdom would be appreciated.

justin
justin
New php-forum User
New php-forum User
 
Posts: 11
Joined: Sun Oct 13, 2002 8:30 pm
Location: toronto

Postby DutchBen » Wed Oct 30, 2002 8:11 am

There are several ways to solve this problem, depending on how many options you want to give your client.
The fastest way is probably to export the names and adresses to a normal text file using Php. You can use acces to generate reports eg. mailing labels, page by page.

Your question is really a little to general to be giving a specifik anserw
DutchBen
New php-forum User
New php-forum User
 
Posts: 36
Joined: Thu Oct 24, 2002 10:28 am
Location: Amsterdam

Postby justin » Wed Oct 30, 2002 9:02 am

tx for responding,
Well, it would work this way, in the administration site, they would have a list of all people in it (or many lists) besides each name their would be a check box(Add to mailing label). if selected the names would be put in a table formatted for mailing size, which would then have to be printed out in some sort of text file that would conform to exact dimensions for the mailing list sticker size that it would be printed on. This would also have to have a function that if more names were selected that could fit on one page, a second page would have to be generated. Forget about access, I am going to use mySQL.
justin
New php-forum User
New php-forum User
 
Posts: 11
Joined: Sun Oct 13, 2002 8:30 pm
Location: toronto

Postby Jay » Wed Oct 30, 2002 9:16 am

justin wrote:tx for responding,
Well, it would work this way, in the administration site, they would have a list of all people in it (or many lists) besides each name their would be a check box(Add to mailing label). if selected the names would be put in a table formatted for mailing size, which would then have to be printed out in some sort of text file that would conform to exact dimensions for the mailing list sticker size that it would be printed on. This would also have to have a function that if more names were selected that could fit on one page, a second page would have to be generated. Forget about access, I am going to use mySQL.

I wouldn't do that. Get them to invest in proper label printing software (MS Word will do). Set that up to print the labels, export the details to a text file and use that to populate the labels.
Jay
 

Postby justin » Wed Oct 30, 2002 9:30 am

ok,
but they then have to cut and paste all the information into word (or inport it into word and then format it) , into the label maker template, we have talked about that allready and they said that they wouldn'd want to do that. Or am I wrong about this ?
justin
New php-forum User
New php-forum User
 
Posts: 11
Joined: Sun Oct 13, 2002 8:30 pm
Location: toronto

Postby DutchBen » Wed Oct 30, 2002 11:13 am

Word has pretty fancy importing options, so does Excel actually, i'm not exactly sure how to do it but i'm pretty sure it's possible. What i do know ... and what i've done before, is to make a link between an Acces Query and labels in Word. This way you select query fields and output them into word labels.

Its a matter of figuring this stuff out because i'm not exactly sure how i used to do it anymore.
DutchBen
New php-forum User
New php-forum User
 
Posts: 36
Joined: Thu Oct 24, 2002 10:28 am
Location: Amsterdam

Postby Jay » Wed Oct 30, 2002 12:40 pm

No no no, this is how you do it!

You set up your script, however you like, to generate a comma delimited text file containing all the data. A CDT file is like this
"Heading1","Heading2","Heading3"
"Row1Value1","Row1Value2","Row1Value3"
"Row2Value1","Row2Value2","Row2Value3"
"Row3Value1","Row3Value2","Row3Value3"

OK, in Word you set up a mail-merge label, and set the file to import as the location where PHP will generate the file (have one made up ready for this part). In your label template (in Word now), enter the fields {{Heading1}} {{Heading2}} {{Heading3}} (using the mail-merge wizard if that's easier) wherever you want the corresponding values to appear, complete the rest of the settings for the label and you're done.

Whenever you want to print labels, make the text file first (get PHP to generate it after a form action), then open up word and it'll load the file and fill in all the values automatically. Simple!
Jay
 

Postby justin » Wed Oct 30, 2002 6:18 pm

tx jay, i tested it and it worked great, thanks for the help, now i just need to figure out how to export a CDT, I should be able to figure it out (still a newbie)

another question though, when i bring it into word it displays it like this

Row1Value1Row1Value2"Row1Value3"

how can i make it look like this

Row1Value1
Row1Value2
Row1Value3

But again, thanks for the help.

justin
justin
New php-forum User
New php-forum User
 
Posts: 11
Joined: Sun Oct 13, 2002 8:30 pm
Location: toronto

Postby justin » Wed Oct 30, 2002 6:24 pm

dont worry, i figured it out
justin
New php-forum User
New php-forum User
 
Posts: 11
Joined: Sun Oct 13, 2002 8:30 pm
Location: toronto


Return to mySQL & php coding

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.