//$year = date('Y-m-d'); $year = date('y')+43;//ปีปัจจุบัน $sql = "SELECT * FROM students INNER JOIN usertype ON (students.usertype_id=usertype.usertype_id)where user_students='".$_SESSION['User']."'"; $result = mysql_query($sql,$c); $fetch = mysql_fetch_assoc($result); echo $year; echo "<br>"; echo $fetch["id_students"]; //รหัสนักศึกษา เก็บเฉพาะ 2 ตัวแรก if($fetch["id_students"]){ }
$year = date('Y') + 543; echo substr($year,0,2);
echo substr('521102064217', 0, 2);
$year = date('Y-m'); //ปีเดือนปัจจุบัน +543 เฉพาะปี ยังไงครับ ? $yearS= "25".substr($fetch["id_students"],0,2); // ผมจะนำไปใส่ ใน Y ยังไงครับ กำหนด m เป็น 06?
$fetch["id_students"] = "521102064217"; $yearS= "25".substr($fetch["id_students"],0,2); $year = date('Y') + 543 . '-' . date('m');//ปัจจุบัน $stdYearMonth = $yearS + 3 . '-' . '06';//เปิดภาคเรียนแรก เดือน มิถุนายน if($stdYearMonth < $year){ echo "ไม่สามรถทำเงือนไขได้"; }else{ echo "OK"; }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง