kahodges Posted March 1, 2010 Share Posted March 1, 2010 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: <?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. Thanks. Link to comment https://forums.phpfreaks.com/topic/193720-need-help-with-generating-mailing-labels-php-to-pdf-script/ Share on other sites More sharing options...
kahodges Posted March 1, 2010 Author Share Posted March 1, 2010 Anyone? Thanks. Link to comment https://forums.phpfreaks.com/topic/193720-need-help-with-generating-mailing-labels-php-to-pdf-script/#findComment-1020057 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.