 |
|
<?
$objConnect = mysql_connect("localhost","TRS473","SK76L") or die("Error Connect to Database");
$objDB = mysql_select_db("output");
$pdf=new PDF();
$pdf->AddFont('angsana','','angsa.php');
$pdf->AddFont('angsana','B','angsab.php');
$pdf->SetFont('angsana','',10);
//หัวเรื่อง//
$pdf->AddPage();
$pdf->SetLeftMargin( 15 );
$pdf->Cell(15,6, iconv( 'UTF-8','tis-620' ,'ลำดับ'),1,0,'C');
$pdf->Cell(40,6, iconv( 'UTF-8','tis-620' ,'หมายเลขสินค้า'),1,0,'C');
$pdf->Cell(55,6, iconv( 'UTF-8','tis-620' ,'ประเภทสินค้า'),1,0,'C');
$pdf->Cell(25,6, iconv( 'UTF-8','tis-620' ,'ผู้ซื้อ'),1,0,'C');
$pdf->Cell(20,6, iconv( 'UTF-8','tis-620' ,'สถานที่'),1,0,'C');
$pdf->Cell(25,6, iconv( 'UTF-8','tis-620' ,'หมายเหตุ'),1,0,'C');
$pdf->Ln();
//=====================================================
$strSQL = "SELECT * FROM output WHERE typeID=018";
$objQuery = mysql_query($strSQL);
while($row = mysql_fetch_array($objQuery)){
$number = $row ['number'];
$outputID = $row['outputID'];
$typeID = $row['typeID'];
$owner = $row['owner'];
$date = $row['date'];
$note = $row['note'];
$under = $row['under'];
$i++;
$pdf->Cell(15,6,$i,1,0,'C');
$pdf->Cell(40,6, iconv( 'UTF-8','tis-620' ,$outputID),1,0,'C');
$pdf->Cell(55,6, $typeID,1,0,'C');
$pdf->Cell(25,6, $owner,1,0,'C');
$pdf->Cell(20,6, $under,1,0,'C');
$pdf->Cell(25,6, iconv( 'UTF-8','tis-620' ,$note),1,0,'C');
$pdf->Ln();
}
$pdf->Output("../tmp/MyPDF.pdf","I");
?>
ผมใช้ AppServ 2.5.10 ปัญหาของผมคือต้องการนำข้อมูลมาจากฐานข้อมูล (utf8_unicode_ci ) มาแสดงลงใน pdf เพื่อสำหรับพิมพ์รายงานแต่พอแสดงผลออกมาแบบนี้ครับ พยายามหามา 4-5 วันแล้วครับ หาข้อมูลและใช้วิธีที่พอจะเป็นไปได้ แต่ก็ไม่เป็นผล รบกวนด้วยครับ แล้วก็หมายเลขสินค้าบันทึกไว้เป็นเลขไทยนะครับ

Tag : PHP, MySQL, Windows
|
ประวัติการแก้ไข 2013-10-02 14:57:01 2013-10-02 15:03:26 2013-10-02 15:04:58 2013-10-02 15:06:40
|
 |
 |
 |
 |
Date :
2013-10-02 14:51:56 |
By :
comhangs |
View :
1392 |
Reply :
6 |
|
 |
 |
 |
 |
|
|
|
 |