Jump to content

SQL Data -> PDF


Fearpig

Recommended Posts

Hi Guys,
I'm trying to use PHP to generate a PDF of my SQL data on demand. I've got the working query in PHP but I'm struggling to integrate this into a PDF.  ???

Can anyone recommend a technique / tutorial or website where I can have a look at this? I've been having a look at FPDF but I'm struggling with the integration for SQL. Here's my PHP query incase that makes a difference:

[code]
include '../ConnectSQL2005.php';


$sql="SELECT * FROM tbl_manuals WHERE Manual = '76FF' ORDER BY Diagram_Key";
$result=odbc_exec($conn,$sql);
if (!$result)
      {exit("Error in SQL");}

echo "<table width=40% border=1 class='Body2'>\n";
echo "<tr align=center bgcolor=#CCCCCC><th>Key</th><th>G. C. Number</th><th>Description</th><th>Part ID</th></tr>\n";

while (odbc_fetch_row($result))
{
$Key=odbc_result($result,"Diagram_Key");
$GC_Number=odbc_result($result,"GC_Number");
$Part_ID=odbc_result($result,"Part_ID");

echo "<tr><td>$Key</td><td>$GC_Number</td><td><i>Desription goes here</i></td><td>$Part_ID</td></tr>\n";
}

echo "</table>\n";
[/code]

Any help would be appreciated as this is a bit of a sticking point for me!  :o
Link to comment
https://forums.phpfreaks.com/topic/27085-sql-data-pdf/
Share on other sites

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.