|
 |
|
php สัปดาห์ที่เท่าไหร่ของปีบ้างที่อยู่ในเดือนนั้น ขอความกรุณา ช่วยหนูด้วยนะคะ |
|
 |
|
|
 |
 |
|
<?
$dbhost = "localhost"; // ชื่อ host ของ web
$dbname = "ชื่อฐานข้อมูล"; // ชื่อ database
$dbuname = "root"; // ชื่อ user
$dbpass = ""; //password ฐานข้อมูล]
$dbtype = "MySQL";
$conn = mysql_connect($dbhost,$dbuname,$dbpass) or die ("Not connect database");
mysql_select_db($dbname,$conn)or die ("Not connect database");
$day_begin = "2006-08-01"; // วันแรกของเดือน
$day_end = "2006-08-31"; // วันสิ้นเดือน
$sql = "select WEEK('$day_begin'), WEEK('$day_end')";
$exc = mysql_query($sql,$conn);
$row = mysql_fetch_array($exc);
$begin = $row[0];
$end = $row[1];
for($i=$begin;$i<$end+1;$i++){
echo $i."<br>";
}
?>
เอาไปปรับใช้เองนะ ครับ 
|
 |
 |
 |
 |
Date :
15 ส.ค. 2549 14:56:57 |
By :
addy |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|