รบกวนช่วยหน่อยค่ะ เราเขียนโปรแกรมที่ค้นหาข้อมูลประเภทวันเกิด พอค้นหาข้อมูลได้ ก็จะสั่งปรินท์ข้อมูลท
แก้ยังไงอ่ะค่ะ ช่วยหน่อยค่ะ ลองหลายวิธีแล้วยังไม่ได้
Date :
2010-06-14 15:30:30
By :
Manow
ไม่ลอง เช็คมันทั้งสามอันเลยอ่าครับ
WHERE $passport_no = '-' AND $hbd = '25/07/1987' AND $add = 'Seattle';
มันก็จะเช็ค 3 อัน ถ้าอันไหนตรงทั้ง 3 อันมันถึงจะดึงข้อมูลออกมา
Date :
2010-06-14 15:32:24
By :
dekcomnvc
สั่งแล้ว ลองสั่งทั้งที่หน้าแสดงข้อมูลก่อนสั่งปรินท์ และที่หน้าสั่งปรินท์ ก็ยังไม่ได้ค่ะ
Date :
2010-06-14 15:42:48
By :
Manow
งั้นรบกวนเอาโค้ดที่ใช้มาลงหน่อยครับ
Date :
2010-06-14 16:55:46
By :
dekcomnvc
Ps. เวลาสั่งปรินท์ ถ้า $passport_no ไม่ตรงกัน ก็จะสั่งปรินท์ได้ปกติ แต่ถ้าตรงกันจะขึ้นชื่อซ้ำกันชื่อเดิมค่ะ
**หน้าแสดงข้อมูล ก่อนสั่งปรินท์**
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>รายงานข้อมูล</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
</head>
<body>
<table width="100%" height="30%" border="1" align="center" cellpadding="0" cellspacing="2" bordercolor="#FFFFFF">
<?
$dd = $_POST[dd];
$mm = $_POST[mm];
if ($dd =="" AND $mm == "")
{
//echo "<div align = center>กรุณาระบุวัน เดือน ที่ต้องการค้นหา";
echo "<script>alert('กรุณาระบุวัน เดือน ที่ต้องการค้นหา');window.location='../P_Major/formSearch_hbd.php';</script>";
}
else if ($dd <> "" AND $mm == "")
{
//echo "<div align = center>กรุณาระบุ เดือน ";
echo "<script>alert('กรุณาระบุ เดือน ที่ต้องการค้นหา');window.location='../P_Major/formSearch_hbd.php';</script>";
}
//---------------- เลือกเดือน----------------//
else if ($dd =="" AND $mm<>"")
{
$count=1;
include "connect.php";
$sql="select * from customers where (mm = '$mm')";
$result=mysql_db_query("$db",$sql);
$num=mysql_num_rows($result);
if($num<=0)
{
/*echo "<br><br><center><strong><font size='3' face='MS Sans Serif, Tahoma, sans-serif'><font color='#FF0000'>ไม่พบข้อมูล</font></font></strong></center>";
echo "<br><div align = center>
<img src=images/previmage.gif width=30 height=20>
<a href = formSearch_hbd.php style = text-decoration:none><font face=MS Sans Serif, Tahoma, sans-serif size=2 color=red><b>Back</b></font></a></div>";*/
echo "<script>alert('ไม่พบข้อมูล');window.location='../P_Major/formSearch_hbd.php';</script>";
exit();
}
else
{
echo "<br><center><strong><font size='3' color = blue face='MS Sans Serif, Tahoma, sans-serif'>พบข้อมูล จำนวน <font color='#FF0000'> $num </font>รายการ</font></strong></center><br>";
echo "
<tr bgcolor='#EAEAEA'>
<td width='3%' height='20%' align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif' color='#000099'><b>...</font></td>
<td width='11%' height='20%' align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif' color='#000099'><b>ชื่อ - นามสกุล</font></td>
<td width='9%' height='20%' align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif' color='#000099'><b>วันเกิด</font></td>
<td width='21%' height='20%' align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif' color='#000099'><b>ที่อยู่</font></td>
<td width='9%' height='20%' align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif' color='#000099'><b>Tel.</font></td>
<td width='9%' height='20%' align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif' color='#000099'><b>Mobile.</font></td>
<td width='20%' height='20%' align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif' color='#000099'><b>Email</font></td>
<td width='13%' height='20%' align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif' color='#000099'><b>สถานที่ทำงาน</font></td>
<td width='5%' height='20%' align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif' color='#FF0000'><b>print</font></td>
</tr>";
while ($r=mysql_fetch_array($result))
{
$passport_no=$r[passport_no];
$th_name=$r[th_name];
$th_surname=$r[th_surname];
$dd=$r[dd];
$mm=$r[mm];
$yyyy=$r[yyyy];
$home_add=$r[home_add];
$soi=$r[soi];
$road=$r[road];
$khet=$r[khet];
$khwaeng=$r[khwaeng];
$province=$r[province];
$zip_code=$r[zip_code];
$home_tel = $r[home_tel];
$mobile = $r[mobile];
$email = $r[email];
$offices = $r[offices];
echo "
<tr bgcolor='#ECFFFF'>
<td align='center'><font face='MS Sans Serif, Tahoma, sans-serif' size='2' color='#FF0000'><b>$count</font><font size='2' face='MS Sans Serif, Tahoma, sans-serif'> - $passport_no</font></td>
<td align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif'>$th_name $th_surname</font></td>
<td align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif'>$dd-$mm-$yyyy</font></td>
<td align='left'><font size='2' face='MS Sans Serif, Tahoma, sans-serif'> $home_add $soi $road $khet $khwaeng $province $zip_code</font></td>
<td align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif'>$home_tel</font></td>
<td align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif'>$mobile</font></td>
<td align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif'>$email</font></td>
<td align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif'>$offices</font></td>
<td align='center'><a href = 'letter.php?passport_no=$r[passport_no]' style = 'text-decoration:none'><img src='images/print.gif'></a></td>
</tr>";
$count++;
}
}
}
//---------------- เลือกวัน-เดือน---------------//
else if ($dd<>"" AND $mm <>"")
{
$count=1;
include "connect.php";
$sql="select * from customers where (dd = '$dd') AND (mm = '$mm') ";
$result=mysql_db_query("$db",$sql);
$num=mysql_num_rows($result);
if($num<=0)
{
/*echo "<br><br><center><strong><font size='3' face='MS Sans Serif, Tahoma, sans-serif'><font color='#FF0000'>ไม่พบข้อมูล</font></font></strong></center>";
echo "<br><div align = center>
<img src=images/previmage.gif width=30 height=20>
<a href = formSearch_hbd.php style = text-decoration:none><font face=MS Sans Serif, Tahoma, sans-serif size=2 color=red><b>Back</b></font></a></div>";*/
echo "<script>alert('ไม่พบข้อมูล');window.location='../P_Major/formSearch_hbd.php';</script>";
exit();
}
else
{
echo "<br><center><strong><font size='3' color = blue face='MS Sans Serif, Tahoma, sans-serif'>พบข้อมูล จำนวน <font color='#FF0000'> $num </font>รายการ</font></strong></center><br>";
echo "
<tr bgcolor='#EAEAEA'>
<td width='3%' height='20%' align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif' color='#000099'><b>...</font></td>
<td width='11%' height='20%' align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif' color='#000099'><b>ชื่อ - นามสกุล</font></td>
<td width='9%' height='20%' align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif' color='#000099'><b>วันเกิด</font></td>
<td width='21%' height='20%' align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif' color='#000099'><b>ที่อยู่</font></td>
<td width='9%' height='20%' align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif' color='#000099'><b>Tel.</font></td>
<td width='9%' height='20%' align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif' color='#000099'><b>Mobile.</font></td>
<td width='20%' height='20%' align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif' color='#000099'><b>Email</font></td>
<td width='13%' height='20%' align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif' color='#000099'><b>สถานที่ทำงาน</font></td>
<td width='5%' height='20%' align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif' color='#FF0000'><b>print</font></td>
</tr>";
while ($r=mysql_fetch_array($result))
{
$passport_no=$r[passport_no];
$th_name=$r[th_name];
$th_surname=$r[th_surname];
$dd=$r[dd];
$mm=$r[mm];
$yyyy=$r[yyyy];
$home_add=$r[home_add];
$soi=$r[soi];
$road=$r[road];
$khet=$r[khet];
$khwaeng=$r[khwaeng];
$province=$r[province];
$zip_code=$r[zip_code];
$home_tel = $r[home_tel];
$mobile = $r[mobile];
$email = $r[email];
$offices = $r[offices];
echo "
<tr bgcolor='#ECFFFF'>
<td align='center'><font face='MS Sans Serif, Tahoma, sans-serif' size='2' color='#FF0000'><b>$count</font><font size='2' face='MS Sans Serif, Tahoma, sans-serif'> - $passport_no</font></td>
<td align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif'>$th_name $th_surname</font></td>
<td align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif'>$dd-$mm-$yyyy</font></td>
<td align='left'><font size='2' face='MS Sans Serif, Tahoma, sans-serif'> $home_add $soi $road $khet $khwaeng $province $zip_code</font></td>
<td align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif'>$home_tel</font></td>
<td align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif'>$mobile</font></td>
<td align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif'>$email</font></td>
<td align='center'><font size='2' face='MS Sans Serif, Tahoma, sans-serif'>$offices</font></td>
<td align='center'><a href = 'letter.php?passport_no=$r[passport_no]' style = 'text-decoration:none'><img src='images/print.gif'></a></td>
</tr>";
$count++;
}
}
}
//mysql_close();
?>
</table>
<br><br>
<div align = "center">
<img src="images/previmage.gif" width="30" height="20">
<a href = "formSearch_hbd.php" style = "text-decoration:none">
<font face="MS Sans Serif, Tahoma, sans-serif" size="2" color="red"><b>Back</b></font></a>
</div>
</body>
</html>
--------------------------------------------------------------------------------------------------------------
**หน้าสั่งปรินท์**
<?
session_start();
require_once("function.php");
$result = select_customers($passport_no);
$row = mysql_fetch_array($result,MYSQL_ASSOC);
?>
<html>
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Angsana New";
panose-1:2 2 6 3 5 4 5 2 3 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:16777219 0 0 0 65537 0;}
@font-face
{font-family:"Cordia New";
panose-1:2 11 3 4 2 2 2 2 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:16777219 0 0 0 65537 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:1627400839 -2147483648 8 0 66047 0;}
@font-face
{font-family:DilleniaUPC;
panose-1:2 2 6 3 5 4 5 2 3 4;
mso-font-charset:222;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:16777217 0 0 0 65536 0;}
@font-face
{font-family:EucrosiaUPC;
panose-1:2 2 6 3 5 4 5 2 3 4;
mso-font-charset:222;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:16777217 0 0 0 65536 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:14.0pt;
font-family:"Cordia New","sans-serif";
mso-fareast-font-family:"Cordia New";
mso-bidi-font-family:EucrosiaUPC;
mso-fareast-language:ZH-CN;}
p.MsoEnvelopeAddress, li.MsoEnvelopeAddress, div.MsoEnvelopeAddress
{mso-style-unhide:no;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:144.0pt;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
mso-element:frame;
mso-element-frame-width:396.0pt;
mso-element-frame-height:99.0pt;
mso-element-frame-hspace:9.0pt;
mso-element-wrap:auto;
mso-element-anchor-horizontal:page;
mso-element-left:center;
mso-element-top:bottom;
mso-height-rule:exactly;
font-size:16.0pt;
font-family:"Cordia New","sans-serif";
mso-fareast-font-family:"Cordia New";
mso-bidi-font-family:"Angsana New";
mso-fareast-language:ZH-CN;}
p.MsoEnvelopeReturn, li.MsoEnvelopeReturn, div.MsoEnvelopeReturn
{mso-style-unhide:no;
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:14.0pt;
font-family:"Cordia New","sans-serif";
mso-fareast-font-family:"Cordia New";
mso-bidi-font-family:"Angsana New";
mso-fareast-language:ZH-CN;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-noshow:yes;
mso-style-unhide:no;
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:8.0pt;
mso-bidi-font-size:9.0pt;
font-family:"Tahoma","sans-serif";
mso-fareast-font-family:"Cordia New";
mso-bidi-font-family:"Angsana New";
mso-fareast-language:ZH-CN;}
span.SpellE
{mso-style-name:"";
mso-spl-e:yes;}
span.GramE
{mso-style-name:"";
mso-gram-e:yes;}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
mso-ascii-font-family:"Cordia New";
mso-fareast-font-family:"Cordia New";
mso-hansi-font-family:"Cordia New";
mso-bidi-font-family:"Angsana New";}
@page Section1
{size:684.0pt 297.0pt;
mso-page-orientation:landscape;
margin:0cm 36.0pt 2.55pt 28.8pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-page-numbers:0;
mso-paper-source:1 0;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:961502515;
mso-list-type:simple;
mso-list-template-ids:-2041556818;}
@list l0:level1
{mso-level-start-at:629;
mso-level-text:%1;
mso-level-tab-stop:237.0pt;
mso-level-number-position:left;
margin-left:237.0pt;
text-indent:-21.0pt;
mso-bidi-language:TH;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style>
<body lang=EN-US style='tab-interval:36.0pt'>
<div class=Section1>
<div style='mso-element:frame;mso-element-frame-width:562.5pt;mso-element-frame-height:
215.85pt;mso-element-wrap:auto;mso-element-anchor-vertical:page;mso-element-left:
72.05pt;mso-element-top:21.65pt'>
<table cellspacing=0 cellpadding=0 hspace=0 vspace=0 width=762 height=288>
<tr>
<td valign=top align=left height=288 style='padding-top:0cm;padding-right:
9.0pt;padding-bottom:0cm;padding-left:9.0pt'>
<p class=MsoEnvelopeAddress style='margin-left:0cm;mso-element:frame;
mso-element-frame-width:562.5pt;mso-element-frame-height:215.85pt;mso-element-wrap:
auto;mso-element-anchor-vertical:page;mso-element-left:72.05pt;mso-element-top:
21.65pt'>
<span style='font-size:22.0pt;mso-bidi-font-family:DilleniaUPC'>
<span style='mso-tab-count:3'> </span>
<span style='mso-tab-count:1'> </span>
<span style='mso-spacerun:yes'> </span>
<span style='mso-tab-count:1'> </span><o:p></o:p>
</span>
</p>
<p class=MsoEnvelopeAddress style='margin-left:0cm;mso-element:frame;
mso-element-frame-width:562.5pt;mso-element-frame-height:215.85pt;mso-element-wrap:
auto;mso-element-anchor-vertical:page;mso-element-left:72.05pt;mso-element-top:
21.65pt'>
<span style='font-size:22.0pt;mso-bidi-font-family:DilleniaUPC'>
<span style='mso-tab-count:5'> </span></span>
<b><span lang=TH style='font-size:24.0pt;font-family:"Angsana New","serif";mso-hansi-font-family:"Cordia New";color:black;mso-ansi-language:TH'>กรุณาส่ง
<span style='mso-spacerun:yes'> </span></span></b>
<b><span lang=TH style='font-size:24.0pt;font-family:"Angsana New","serif";mso-hansi-font-family:"Cordia New";color:black'>
<span style='mso-spacerun:yes'></span><?=$row["th_name"]?> <?=$row["th_surname"]?>
<span style='mso-spacerun:yes'> </span>
<span style='mso-spacerun:yes'> </span>
<span style='mso-spacerun:yes'> </span></span></b>
<span lang=TH style='font-size:22.0pt;font-family:"DilleniaUPC","serif";color:black'><o:p></o:p></span></p>
<p class=MsoEnvelopeAddress style='mso-element:frame;mso-element-frame-width:
562.5pt;mso-element-frame-height:215.85pt;mso-element-wrap:auto;mso-element-anchor-vertical:
page;mso-element-left:72.05pt;mso-element-top:21.65pt'>
<span lang=TH
style='font-size:14.0pt;font-family:"Angsana New","serif";mso-hansi-font-family:
"Cordia New";color:black;mso-ansi-language:TH'>
<span style='mso-tab-count:
2'> </span>
<span
style='mso-tab-count:1'> </span></span>
<b><span
style='font-size:24.0pt;font-family:"Angsana New","serif";mso-hansi-font-family:
"Cordia New";color:black'> <?=$row["home_add"]?>
<span lang=TH> <?=$row["soi"]?></span>
<span class=GramE>
<span lang=TH> <?=$row["road"]?>
<span style='mso-spacerun:yes'> </span>
</span></span></span></b>
<b><span
lang=TH style='font-size:20.0pt;font-family:"Angsana New","serif";mso-hansi-font-family:
"Cordia New";color:black;mso-ansi-language:TH'>
<span style='mso-spacerun:yes'> </span><o:p></o:p></span></b></p>
<p class=MsoEnvelopeAddress style='mso-element:frame;mso-element-frame-width:
562.5pt;mso-element-frame-height:215.85pt;mso-element-wrap:auto;mso-element-anchor-vertical:
page;mso-element-left:72.05pt;mso-element-top:21.65pt'>
<b><span lang=TH
style='font-size:20.0pt;font-family:"Angsana New","serif";mso-hansi-font-family:
"Cordia New";color:black;mso-ansi-language:TH'>
<span style='mso-tab-count:
2'> </span>
<span
style='mso-tab-count:1'> </span></span></b>
<b><span
lang=TH style='font-size:24.0pt;font-family:"Angsana New","serif";mso-hansi-font-family:
"Cordia New";color:black'> <?=$row["khet"]?>
<span class=SpellE></span><span
style='mso-spacerun:yes'> </span><?=$row["khwaeng"]?></span></b>
<b><span
lang=TH style='font-size:20.0pt;font-family:"Angsana New","serif";mso-hansi-font-family:
"Cordia New";color:black;mso-ansi-language:TH'>
<span
style='mso-spacerun:yes'> </span><span
style='mso-spacerun:yes'> </span><o:p></o:p></span></b></p>
<p class=MsoEnvelopeAddress style='mso-element:frame;mso-element-frame-width:
562.5pt;mso-element-frame-height:215.85pt;mso-element-wrap:auto;mso-element-anchor-vertical:
page;mso-element-left:72.05pt;mso-element-top:21.65pt'>
<b><span lang=TH
style='font-size:24.0pt;font-family:"Angsana New","serif";mso-hansi-font-family:
"Cordia New";color:black;mso-ansi-language:TH'>
<span style='mso-tab-count:
2'> </span>
<span
style='mso-tab-count:1'> </span> <?=$row["province"]?></span></b>
<b><span style='font-size:20.0pt;font-family:"Angsana New","serif";
mso-hansi-font-family:"Cordia New";color:black'><?=$row["zip_code"]?><o:p></o:p></span></b></p>
<p class=MsoEnvelopeAddress style='margin-left:0cm;mso-element:frame;
mso-element-frame-width:562.5pt;mso-element-frame-height:215.85pt;mso-element-wrap:
auto;mso-element-anchor-vertical:page;mso-element-left:72.05pt;mso-element-top:
21.65pt'>
<b><span lang=TH style='font-size:20.0pt;font-family:"Angsana New","serif";
mso-hansi-font-family:"Cordia New";color:black'>
<span style='mso-tab-count:
2'> </span>
<span
style='mso-spacerun:yes'> </span>
<span style='mso-tab-count:6'> </span>
<span style='mso-spacerun:yes'> </span><o:p></o:p></span></b>
</p>
<p class=MsoEnvelopeAddress style='margin-left:216.0pt;mso-element:frame;
mso-element-frame-width:562.5pt;mso-element-frame-height:215.85pt;mso-element-wrap:
auto;mso-element-anchor-vertical:page;mso-element-left:72.05pt;mso-element-top:
21.65pt'>
<span style='font-size:14.0pt;font-family:"Angsana New","serif";
mso-hansi-font-family:"Cordia New"'>
<span style='mso-tab-count:2'> </span><o:p></o:p></span>
</p>
<p class=MsoEnvelopeAddress style='mso-element:frame;mso-element-frame-width:
562.5pt;mso-element-frame-height:215.85pt;mso-element-wrap:auto;mso-element-anchor-vertical:
page;mso-element-left:72.05pt;mso-element-top:21.65pt'>
<span
style='font-size:14.0pt;font-family:"Angsana New","serif";mso-hansi-font-family:
"Cordia New"'><o:p> </o:p></span>
</p>
<p class=MsoEnvelopeAddress style='mso-element:frame;mso-element-frame-width:
562.5pt;mso-element-frame-height:215.85pt;mso-element-wrap:auto;mso-element-anchor-vertical:
page;mso-element-left:72.05pt;mso-element-top:21.65pt'>
<span
style='font-size:14.0pt;font-family:"Angsana New","serif";mso-hansi-font-family:
"Cordia New"'><o:p> </o:p></span>
</p>
<p class=MsoEnvelopeAddress style='mso-element:frame;mso-element-frame-width:
562.5pt;mso-element-frame-height:215.85pt;mso-element-wrap:auto;mso-element-anchor-vertical:
page;mso-element-left:72.05pt;mso-element-top:21.65pt'>
<span lang=TH
style='font-size:20.0pt;font-family:"Angsana New","serif";mso-hansi-font-family:
"Cordia New";mso-ansi-language:TH'>
<span style='mso-tab-count:2'> </span></span>
<span
style='font-size:20.0pt;font-family:"Angsana New","serif";mso-hansi-font-family:
"Cordia New"'>
<span
style='mso-spacerun:yes'>
</span></span>
<span style='font-size:14.5pt;mso-bidi-font-family:DilleniaUPC'><o:p></o:p></span>
</p>
</td>
</tr>
</table>
</div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>
---------------------------------------------------------------------------------------------------
Date :
2010-06-14 17:15:13
By :
Manow
ขอดูฟังก์ชั่น select_customers หน่อยครับ
Date :
2010-06-14 17:44:00
By :
jeabz
function select_customers($passport_no)
{
$con=connect("db_major");
if(!$con)
echo "เกิดความผิดพลาดไม่สามารถติดต่อกับฐานข้อมูลได้";
$sql="select * from customers where passport_no = '$passport_no'";
$result = mysql_query($sql);
if(!$result)
return 0;
else
return $result;
}
Date :
2010-06-15 09:16:28
By :
MaNow
แล้วถ้าเปลี่ยนเป็นเอา id เป็น primary key ละครับ แล้วเวลาสั่งปริ้นก็ให้ id=$id แทน พอไหวไหมครับ
Date :
2010-06-15 09:28:05
By :
Dragons_first
หรือต้องทำฐานข้อมูลใหม่แล้วตั้งให้ตัวแปลใดตัวแปลหนึ่งเป็นไพรมารี่คีย์ถึงจะได้อ่ะค่ะ
แล้วตอน select ก็ตั้งค่าตัวแปลที่เป็นไพรมารี่คีย์เป็นหลัก ถึงจะได้
เพราะตอนนี้ฐานข้อมูลไม่มีค่าไพรมารี่คีย์ ค่าหลักที่ select เลยเป็นค่าแรกของฐานข้อมูล
มันเกี่ยวกันรึป่าวค่ะ
Date :
2010-06-15 13:07:44
By :
Manow
Load balance : Server 03