|
 |
|
รบกวนช่วยดู โค้ดหน่อยครับ ใช่คำสั่ง while($result=mysql_fetch_array($sqlquery); แล้วเวลาแสดงไม่ครบทุกฟิลครับ |
|
 |
|
|
 |
 |
|
อัปสคริปผิดป่ะครับ
|
 |
 |
 |
 |
Date :
2012-04-23 06:04:49 |
By :
deawx |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทำไมไม่ปิด while ตั้งแต่ข้างบน
มันถูกแล้วหรอ ?
|
 |
 |
 |
 |
Date :
2012-04-23 10:48:11 |
By :
rootElement@kmutnb |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ดูแล้วเหมือนจะให้ ลูป page นี้ ตามจำนวนที่ query ค้นหาได้เลยนะ
เหอๆ
|
 |
 |
 |
 |
Date :
2012-04-23 10:54:51 |
By :
compeng |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
echo "<br>".$toDay = strtotime($result['auction_time']);
ผมก็ว่ามันไม่น่าจะถูกนะ
|
 |
 |
 |
 |
Date :
2012-04-23 11:05:56 |
By :
rootElement@kmutnb |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอารูปมาลงดีกว่าครับ
แล้วก็คลิกขวา view source เอา html มาแปะด้วยก็ดี
|
 |
 |
 |
 |
Date :
2012-04-23 11:17:51 |
By :
rootElement@kmutnb |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
HTML ครับ
คือ ตอนคุณเปิดดูผลลัพธ์
IE คลิกขวา View source
Fire fox ภาษาไทย คลิกขวา ดูซอสโค็ต
แล้วก็อบหน้าที่มันเป็น HTML มาลงครับ
็*** HTML ตอนแสดงผล ไม่ใช่ PHP
|
 |
 |
 |
 |
Date :
2012-04-23 11:51:20 |
By :
rootElement@kmutnb |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตอบความคิดเห็นที่ : 10 เขียนโดย : rootElement@kmutnb เมื่อวันที่ 2012-04-23 11:51:20
รายละเอียดของการตอบ ::
นี่ครับ
Code
<br>2012-04-30 12:00:00<br><br>1335762000<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis620" />
<script type="text/javascript" src="easyslider1.7/js/jquery.js"></script>
<title>สอนเขียนโค๊ดนับเวลาถอยหลัง</title>
<script type="text/javascript">
function countDown(times){//times ค่าเวลาต้องเป็น timeslamp เท่านั้น
//ตัวแปร toDay รับค่าวันเวลาปัจจุบันแบบ timestamp
var toDay=Math.round(new Date().getTime()/1000); //ค่าของ timestamp โดยหาร 1000 จะได้ค่าเป็นแบบ second
//หาวันเวลาที่เหลือ อ้างอิงจาก http://www.thai-access.com/topic_post.asp?CategoryID=1&TopicID=2431
var difTime=times-toDay;
var day=0,hours=0,minutes=0,seconds=0;
if(difTime>0){//หากเวลายังไม่หมด
day=Math.floor(difTime/84600);//หาค่าวัน
hours=Math.floor((difTime/3600))%24;//หาชั่วโมง
minutes=Math.floor(difTime/60)%60;//หานาที
seconds=Math.floor(difTime)%60;//หาวินาที
countDown_onLoad();//ทำงานต่อ
}else{//ถ้าหมดเวลา
alert('หมดเวลา');
//สามารถเขียนcodeเพิ่มเติมในส่วนนี้ได้ เช่น ถ้าหมดเวลาแล้วให้redirectไปหน้าindex.php ให้ใช้คำสั่ง window.location='index.php';
}
$('.showTime').html(day+' วัน '+hours+' ชั่วโมง '+minutes+' นาที '+seconds+' วินาที ');
}
function countDown_onLoad(){
//แทรกcode PHP เข้าไปใน Javascript ได้เลย
setTimeout("countDown(1335762000);",1000);//1000=1วินาที
}
$(document).ready(function() {
countDown_onLoad();
});
</script>
</head>
<body>
<div class="showTime"></div><!--แสดงผลลัพธุ์ตรงนี้-->
<br>2012-04-25 12:12:00<br><br>1335330720<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis620" />
<script type="text/javascript" src="easyslider1.7/js/jquery.js"></script>
<title>สอนเขียนโค๊ดนับเวลาถอยหลัง</title>
<script type="text/javascript">
function countDown(times){//times ค่าเวลาต้องเป็น timeslamp เท่านั้น
//ตัวแปร toDay รับค่าวันเวลาปัจจุบันแบบ timestamp
var toDay=Math.round(new Date().getTime()/1000); //ค่าของ timestamp โดยหาร 1000 จะได้ค่าเป็นแบบ second
//หาวันเวลาที่เหลือ อ้างอิงจาก http://www.thai-access.com/topic_post.asp?CategoryID=1&TopicID=2431
var difTime=times-toDay;
var day=0,hours=0,minutes=0,seconds=0;
if(difTime>0){//หากเวลายังไม่หมด
day=Math.floor(difTime/84600);//หาค่าวัน
hours=Math.floor((difTime/3600))%24;//หาชั่วโมง
minutes=Math.floor(difTime/60)%60;//หานาที
seconds=Math.floor(difTime)%60;//หาวินาที
countDown_onLoad();//ทำงานต่อ
}else{//ถ้าหมดเวลา
alert('หมดเวลา');
//สามารถเขียนcodeเพิ่มเติมในส่วนนี้ได้ เช่น ถ้าหมดเวลาแล้วให้redirectไปหน้าindex.php ให้ใช้คำสั่ง window.location='index.php';
}
$('.showTime').html(day+' วัน '+hours+' ชั่วโมง '+minutes+' นาที '+seconds+' วินาที ');
}
function countDown_onLoad(){
//แทรกcode PHP เข้าไปใน Javascript ได้เลย
setTimeout("countDown(1335330720);",1000);//1000=1วินาที
}
$(document).ready(function() {
countDown_onLoad();
});
</script>
</head>
<body>
<div class="showTime"></div><!--แสดงผลลัพธุ์ตรงนี้-->
<br>2012-04-30 12:00:00<br><br>1335762000<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis620" />
<script type="text/javascript" src="easyslider1.7/js/jquery.js"></script>
<title>สอนเขียนโค๊ดนับเวลาถอยหลัง</title>
<script type="text/javascript">
function countDown(times){//times ค่าเวลาต้องเป็น timeslamp เท่านั้น
//ตัวแปร toDay รับค่าวันเวลาปัจจุบันแบบ timestamp
var toDay=Math.round(new Date().getTime()/1000); //ค่าของ timestamp โดยหาร 1000 จะได้ค่าเป็นแบบ second
//หาวันเวลาที่เหลือ อ้างอิงจาก http://www.thai-access.com/topic_post.asp?CategoryID=1&TopicID=2431
var difTime=times-toDay;
var day=0,hours=0,minutes=0,seconds=0;
if(difTime>0){//หากเวลายังไม่หมด
day=Math.floor(difTime/84600);//หาค่าวัน
hours=Math.floor((difTime/3600))%24;//หาชั่วโมง
minutes=Math.floor(difTime/60)%60;//หานาที
seconds=Math.floor(difTime)%60;//หาวินาที
countDown_onLoad();//ทำงานต่อ
}else{//ถ้าหมดเวลา
alert('หมดเวลา');
//สามารถเขียนcodeเพิ่มเติมในส่วนนี้ได้ เช่น ถ้าหมดเวลาแล้วให้redirectไปหน้าindex.php ให้ใช้คำสั่ง window.location='index.php';
}
$('.showTime').html(day+' วัน '+hours+' ชั่วโมง '+minutes+' นาที '+seconds+' วินาที ');
}
function countDown_onLoad(){
//แทรกcode PHP เข้าไปใน Javascript ได้เลย
setTimeout("countDown(1335762000);",1000);//1000=1วินาที
}
$(document).ready(function() {
countDown_onLoad();
});
</script>
</head>
<body>
<div class="showTime"></div><!--แสดงผลลัพธุ์ตรงนี้-->
<br>2012-05-02 10:10:00<br><br>1335928200<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis620" />
<script type="text/javascript" src="easyslider1.7/js/jquery.js"></script>
<title>สอนเขียนโค๊ดนับเวลาถอยหลัง</title>
<script type="text/javascript">
function countDown(times){//times ค่าเวลาต้องเป็น timeslamp เท่านั้น
//ตัวแปร toDay รับค่าวันเวลาปัจจุบันแบบ timestamp
var toDay=Math.round(new Date().getTime()/1000); //ค่าของ timestamp โดยหาร 1000 จะได้ค่าเป็นแบบ second
//หาวันเวลาที่เหลือ อ้างอิงจาก http://www.thai-access.com/topic_post.asp?CategoryID=1&TopicID=2431
var difTime=times-toDay;
var day=0,hours=0,minutes=0,seconds=0;
if(difTime>0){//หากเวลายังไม่หมด
day=Math.floor(difTime/84600);//หาค่าวัน
hours=Math.floor((difTime/3600))%24;//หาชั่วโมง
minutes=Math.floor(difTime/60)%60;//หานาที
seconds=Math.floor(difTime)%60;//หาวินาที
countDown_onLoad();//ทำงานต่อ
}else{//ถ้าหมดเวลา
alert('หมดเวลา');
//สามารถเขียนcodeเพิ่มเติมในส่วนนี้ได้ เช่น ถ้าหมดเวลาแล้วให้redirectไปหน้าindex.php ให้ใช้คำสั่ง window.location='index.php';
}
$('.showTime').html(day+' วัน '+hours+' ชั่วโมง '+minutes+' นาที '+seconds+' วินาที ');
}
function countDown_onLoad(){
//แทรกcode PHP เข้าไปใน Javascript ได้เลย
setTimeout("countDown(1335928200);",1000);//1000=1วินาที
}
$(document).ready(function() {
countDown_onLoad();
});
</script>
</head>
<body>
<div class="showTime"></div><!--แสดงผลลัพธุ์ตรงนี้-->
</body>
</html>
|
 |
 |
 |
 |
Date :
2012-04-23 11:58:11 |
By :
showroom |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทีนี้เห็นหรือยังว่ามันมีอะไรแปลกๆ
ที่จริงการแสดงผลมันมีแค่นี้ไม่ใช่หรอ ?
Code (PHP)
while($result = mysql_fetch_array($sqlquery)){
echo "<br>".$result['auction_time']."<br>";
echo "<br>".strtotime($result['auction_time']);
}
|
 |
 |
 |
 |
Date :
2012-04-23 13:09:14 |
By :
rootElement@kmutnb |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|