Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
php/mysql to pdf mailing labels
Old 03-01-2010, 04:31 PM php/mysql to pdf mailing labels
Junior Talker

Posts: 2
Name: KA Hodges
Trades: 0
I'm using the script at the link below:
http://www.ros.co.nz/pdf/user.php

I can get the pdf file to generate, but I'm having trouble figuring out how to get the mysql data to populate into the labels, the arrays, etc..

Here is the code I have so far:

Code:
Code:
<?php
## include the class
include ('class.label.inc');
## connect to the database
$host = 'localhost';
$user = 'myusername';
$password = 'mypassword';

$database = 'mydatabase';
$query = 'select * from employees';
//--------------------------------------------------

// open the connection to the db server
$link = mysql_connect($host,$user,$password);
// change to the right database
mysql_select_db($database);
// do the SQL query
$query = "SELECT employee_name, street_address, City, state, zip_code FROM employees ORDER BY employee_name";
$result = mysql_query($query) or die('Error, query failed');
while($data[] =  mysql_fetch_assoc($result)) {}

## choose a labeltype
$labeltype="Av5160";

## create a new instance of the class of that labeltype
$label= new Clabel($labeltype);

// initialize the array
$data = array();
$info=array(1=>array('line1'=>'employee_name', 'line2'=>'street_address', 'line3'=>'', 'line4'=>'City'.'state'.'zip_code'),);
reset($info); ## just to be sure

## make the labels!
$label->makeLabel($info);
?>
I'd really appreciate some help getting this to work.

Thanks.
kahodges is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to php/mysql to pdf mailing labels
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18530 seconds with 12 queries