i have created resume database... i retrieve all the details about a particular candidate from the database. after displaying the results, i want to create a pdf file for that particular candidate...
if i click a link it should generate a pdf that contain all the details about the candidate.
plz help. urgent. thank you.
7 2646
Use a ready built php PDF class.
ezpdf and FPDF are two I am aware of.
Only ever used FPDF which is quite fiddly but a pretty good support site
whats wrong in this code?
the value is not display in the pdf. -
<?php
-
require('fpdf\fpdf.php');
-
include("config.php");
-
-
$id = @$_GET['id'] ;
-
$query1="SELECT * FROM candidate where cid='$id'";
-
$result1=mysql_query($query1);
-
-
//$row = mysql_fetch_array($result1);
-
$cname = mysql_fetch_array($result1);
-
$cid = mysql_fetch_array($result1);
-
-
$pdf=new FPDF();
-
$pdf->AddPage();
-
$pdf->SetFont('Arial','B',16);
-
-
$pdf->Cell(0,10,'Candidate Name'.$cname,0,1);
-
$pdf->Cell(0,20,'Candidate Id'.$cid,0,1);
-
$pdf->Output();
-
?>
-
How to display data from the database in the pdf. pdf is generating bt no details displayed.plz help
this code working fine. it displays all the vaules from the table. but i want to display only single candidate's details. -
<?php
-
require('fpdf\fpdf.php');
-
include("config.php");
-
-
$id = @$_GET['id'] ;
-
-
$query="SELECT * FROM candidate";
-
$result=mysql_query($query);
-
$num=mysql_numrows($result);
-
-
$column_cname = "";
-
$column_cid = "";
-
-
-
while($row = mysql_fetch_array($result))
-
{
-
$cname = $row["cid"];
-
$cid = substr($row["cname"],0,20);
-
-
$column_cname = $column_cname.$cname."\n";
-
$column_cid = $column_cid.$cid."\n";
-
-
}
-
-
-
//$row = mysql_fetch_array($result1);
-
//$cname = mysql_fetch_array($result1);
-
-
$pdf=new FPDF();
-
$pdf->AddPage();
-
$pdf->SetFont('Arial','B',16);
-
-
-
$pdf->Cell(20,6,$column_cname,1);
-
-
$pdf->Cell(100,6,$column_cid,1);
-
-
-
$i = 0;
-
-
while ($i < $num)
-
{
-
$pdf->SetX(45);
-
$pdf->MultiCell(120,6,'',1);
-
$i = $i +1;
-
}
-
-
//$pdf->Cell(0,10,'Name'.$cname,0,1);
-
-
-
$pdf->Output();
-
?>
-
if i change the code like this -
$query="SELECT * FROM candidate where cid="$id";
-
nothing will display... in order to get single candidate details how to change this code. please help.
if i give input in the query as cid='14', it works fine. -
$query="SELECT * FROM candidate where cid='14'";
-
but when i pass the value of cid like and get the value means, -
$id = $_GET['id'] ;
-
$query="SELECT * FROM candidate WHERE cid='$id'";
-
i get an error in the pdf.
FPDF error: Some data has already been output to browser, can't send PDF file like this...
You have an echo statement, or code outside php tags, (including blank spaces) somewhere
i corrected those things, but i don't get any result. but the pdf is generated with no data. just display like this.
Name :
Id:
Phone:
but no data from database... -
$query="SELECT * FROM candidate where cid='14'";
-
for this code i get results from database
Name: James
Id:14
Ph:+91 2324343
It works fine. i thing its something in that select query... I'm getting the cid value from the previous page.
so please help...
i thing its something in that select query... I'm getting the cid value from the previous page.
You are stabbing in the dark!
Is the problem occurring from the web-form, the query or the PDF?
You need to get some debugging statements in there.
Echo out the contents of variables from the web-form,
the data returned from the query and the PDF data.
At a guess I think the web-form is wrong
Sign in to post your reply or Sign up for a free account.
Similar topics
by: james545 |
last post by:
I am having a problem with ofstream creating files. Sometimes when I
run the program, ofstream creates a new file for writing and writes to
it. No problem. But sometimes it fails to create the...
|
by: monomaniac21 |
last post by:
Hi everyone
i'm trying to setup my website to create new webpages dynamically using
php but I am have a major problem in that whenever i create a file it
is always created locked so that it can...
|
by: Daniel Walzenbach |
last post by:
Hi,
Imagine the following situation: I have an asp.net
application which allows uploading files to a SQL Server
2000 database (Files are stored as type "images"). As a
next step I would like to...
|
by: Mamatha |
last post by:
Hi friends,
I have an application using mutithreads.In that
application one threads writes the data in to a file.
Another thread reads the data from same file.
So some errors while at the time...
|
by: Vanga Sasidhar |
last post by:
Already posted the same message but the date and time of my machine was set
back. and it was listed under the old date. Thats why I am posting the same
message again. Please accept this.
...
|
by: Grace |
last post by:
Does it have any ways that asp.net web application can create the file on
client computer or
get files from client computer?
Thanks.
|
by: asenthil |
last post by:
i'm trying to read and write files using java...
some errors occurs when i'm trying this code..
Error in java: Cannot find symbol
location: class java.io.FileOutputStream
FileOutputStream...
|
by: reon |
last post by:
While we can create files using c++...
Is there any code relating to create folders in c++..
|
by: satyanagendra |
last post by:
hi,
Can we create DLL using turboc in windows. I am able to create static libraries using turboc. But I don't know how to make DLL files using turboc
If it is possible tell me how to make and...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |