Jump to content

Recommended Posts

I am trying to pull some info from my database and print it in the spots that I have the X and Y coordinates for. How would i print the info in the spots??????

 

 

<?php

//SHOW A DATABASE ON A PDF FILE
define('FPDF_FONTPATH','font/');
require('fpdf.php');

//Create a new PDF file
$pdf=new FPDF();
$pdf->Open();
$pdf->AddPage();

mysql_connect('HOST', 'USERNAME', 'PASSWORD')
    or die('Could not connect: ' . mysql_error());
mysql_select_db('software') or die('Could not select database');

$result=mysql_query('select Date,Name,TotalPrice from Invoices ORDER BY Date');
$number_of_products = mysql_numrows($result);


//Initialize the 3 columns and the total
$column_date = "";
$column_name = "";
$column_totalprice = "";
$total = 0;

mysql_close();

//Convert the Total Price to a number with (.) for thousands, and (,) for decimals.
$total = number_format($total,',','.','.');

//Fields Name position
$Y_Fields_Name_position = 20;
//Table position, under Fields Name
$Y_Table_Position = 26;
//Now show the 15 columns
//First Check
$pdf->SetFont('Arial','',18);
$pdf->Text(125,20,'Date'); <---- This should be replaced with database info
$pdf->Text(35,35,'Name');  <---- This should be replaced with database info
$pdf->Text(160,35,'TotalPrice');  <---- This should be replaced with database info
$pdf->Text(5,45,'One Million and 0/100 ****************************************');  <---- This should be replaced with database info

$pdf->Text(8,82,'Signature');  <---- This should be replaced with database info
$pdf->Output();
?>

Link to comment
https://forums.phpfreaks.com/topic/86531-solved-help-me/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.