Jump to content

[SOLVED] FPDF (php) and inserting data from a second table


andretanguy

Recommended Posts

im trying to insert this:

 

the database connection has already been made and is working.

 

userid is posted from the previous page and is working - for the sake of this, lets say the userid = 101

userid is referenced like so: $l_userid

 

<?

 

$query = "SELECT name, userid FROM AD747_LISTING WHERE id =".$l_userid;

$list_array = mysql_query($query);

if($row = mysql_fetch_array($list_array))

{

$name = $row['name'];

$userid = $row['userid'];

}

if(!empty($userid))

{

$query = "SELECT customers_firstname, customers_lastname, customer_email_address, phone, mobile FROM USERS WHERE userid =".$l_userid;

$user_array = mysql_query($query);

if($row = mysql_fetch_array($user_array))

{

$firstname = $row['customers_firstname'];

$lastname = $row['customers_lastname'];

$phone = $row['phone'];

$mobile = $row['mobile'];

$email = $row['customer_email_address'];

}

}?>

 

<?

 

$pdf->Cell( 30, 5, "Contact Name:", 0, 0, 'L' );

$pdf->Cell( 0, 5, "$firstname $lastname", 0, 1, 'L' );

 

$pdf->Cell( 30, 5, "Owner Email:", 0, 0, 'L' );

$pdf->Cell( 0, 5, $email, 0, 1, 'L' );

 

 

$pdf->Cell( 30, 5, "Contact Tel:", 0, 0, 'L' );

$pdf->Cell( 0, 5, $phone, 0, 1, 'L' );

 

$pdf->Cell( 30, 5, "Contact Mobile:", 0, 0, 'L' );

$pdf->Cell( 0, 5, $mobile, 0, 1, 'L' );

 

?>

 

 

any help would be much appreciated

 

André

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.