|
 |
|
ดูโค้ดนี้ให้ทีครับแบบว่าค่า z มันไม่ยอมเปลี่ยนตามการคำนวนวันที่ครับ |
|
 |
|
|
 |
 |
|
ดูโค้ดนี้ให้ทีครับแบบว่าค่า z มันไม่ยอมเปลี่ยนตามการคำนวนวันที่ครับ
แบบว่าผมแปลงวันที่จากตัวแปล $BirthDate ให้เป็น d/m/Y แบบภาษาไทยอะครับ
แต่กลับเวลาแสดงมันจำค่าที่คำนวนได้ครั้งแรกของแถวที่ 1 มาแสดงเป็นแบบนั้ทุกแถว
สังเกตตรงวันที่ นะครับ 31/12/2512 แสดงเหมือนกันทุกแถวก็เลยไม่รู้จะแก้ยังงัยดีครับ รบกวนทีนะครับ....
3310500392201 พิทยา ปฏิโค 31/12/2512 2005-03-16 00:00:00 2512 1981-03-14 00:00:00 10908 10908
1311400012894 พิทยา แก้วดวงดี 31/12/2512 2006-02-01 00:00:00 2512 1985-03-08 00:00:00 10908 03037
<?
$i=1;
while(odbc_fetch_row($execute,$i))
{
$z="";
$CID=odbc_result($execute,"CID");
$Title=odbc_result($execute,"Title");
$Lname=odbc_result($execute,"Lname");
$Fname=odbc_result($execute,"Fname");
$Lname=odbc_result($execute,"Lname");
$BirthDate=odbc_result($execute,"BirthDate");
$StartDate=odbc_result($execute,"StartDate");
$ExpDate=odbc_result($execute,"ExpDate");
$Hmain2=odbc_result($execute,"Hmain2");
$Hsub2=odbc_result($execute,"Hsub2");
$b=Date("d/m",$BirthDate);
$x=Date("Y",$BirthDate)+543;
$z="$b/$x";
?>
<tr>
<td height="25"> <span class="style3"><?php echo "$CID" ?></span></td>
<td><span class="style3"> <?php echo "$Title$Fname"." "."$Lname"; ?></span></td>
<td><span class="style3"><?php echo "$z"?></span></td>
<td> <span class="style3"><?php echo "$StartDate" ?></span></td>
<td> <span class="style3"><?php echo "$ExpDate" ?></span></td>
<td> <span class="style3"><?php echo "$x" ?></span></td>
<td> <span class="style3"><?php echo "$BirthDate" ?></span></td>
<td> <span class="style3"><?php echo "$Hmain2" ?></span></td>
<td> <span class="style3"><?php echo "$Hsub2" ?></span></td>
</tr>
<?
$i++;
}
?>
<?
odbc_close($connect);
?>
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
18 เม.ย. 2549 12:55:22 |
By :
ครูน้อย |
View :
2298 |
Reply :
0 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
|
|

|
Load balance : Server 04
|