สอนได้ละเอียดและง่าย เขาสอนได้ดีจริง ๆ เลยครับ ตามลิ้งค์นี้เลยครับ
http://www.hellomyweb.com/index.php/main/content/26
พีเอ็ม คอม แหล่งรวบรวมสาระความรู้ แบ่งปัน และน้ำใจ ในการให้ความรู้ทางด้านคอมพิวเตอร์ อยากรู้อะไรเข้ามาสอบถามได้เลย โปรแกรมฟรี Open Source และอื่น ๆ อีกมากมาย
12 มิถุนายน 2555
11 มิถุนายน 2555
04 มิถุนายน 2555
แก้ปัญหาติดตั้ง Kaspersky Internet Security 2012 แล้วเชื่อม Lan ไม่ได้
26 เมษายน 2555
กำหนดค่าให้ Mysql เชื่อมต่อจากภายนอกได้ เช่น MySQL Front
ขณะที่ผมใช้ Direct Admin เกิดปัญหาว่าจะเชื่อมต่อ Mysql จากภายนอก
เลยลองดูวิธีนี้ ใช้งานได้
เก็บเอาไว้เผื่อลืมครับ
เข้าไปจัดการใน Mysql Management ของ Direct Admin ดังนี้ครับ
เลยลองดูวิธีนี้ ใช้งานได้
เก็บเอาไว้เผื่อลืมครับ
เข้าไปจัดการใน Mysql Management ของ Direct Admin ดังนี้ครับ
23 เมษายน 2555
การทำ LOG USER เมื่อ User LOGIN เข้าใช้งาน ใน PHP
Step.1 สร้างฐานข้อมูลCREATE TABLE `db_userlog` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`username` char(6) DEFAULT NULL,
`userip` char(15) DEFAULT NULL,
`logindate` datetime DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
Step 2. เพิ่มโค้ดบรรทัดนี้
mysql_query("insert db_userlog(username,userip,logindate) values('".$_SESSION["user_name"]."','".$_SERVER['REMOTE_ADDR']."','".date('Y-m-d H-i-s')."')");
ลงในไฟล์ Login เมื่อเข้าสู่ระบบได้
Step 3. โค้ดสำหรับแสดงข้อมูล รายวัน รายเืดือน รายปี
require('connect.php');
echo '<br/>วันนี้ :'.showsumlog_less(date("Y-m-d", strtotime("today")));
echo '<br/>เมื่อวานนี้ :'.showsumlogl_between(date("Y-m-d", strtotime("-1day")),date("Y-m-d", strtotime("today")));
echo '<br/>สองวันนี้ :'.showsumlog_less(date("Y-m-d", strtotime("first day of this month")));
echo '<br/>เดือนนี้ :'.showsumlog_less(date("Y-m-d", strtotime("first day of this month")));
echo '<br/>รอบสามสิบวัน:'.showsumlog_less(date("Y-m-d", strtotime("-30day")));
echo '<br/>รอบหกสิบวัน:'.showsumlog_less(date("Y-m-d", strtotime("-60day")));
echo '<br/>ปีนี้:'.showsumlog_less(date("Y-m-d", strtotime("first day of January this Year")));
echo '<br/>ปีนี้ที่แล้ว:'.showsumlogl_between(date("Y-m-d", strtotime("first day of january last Year")),date("Y-m-d", strtotime("first day of January this Year")));
mysql_close($con);
echo '<br/>วันนี้ :'.showsumlog_less(date("Y-m-d", strtotime("today")));
echo '<br/>เมื่อวานนี้ :'.showsumlogl_between(date("Y-m-d", strtotime("-1day")),date("Y-m-d", strtotime("today")));
echo '<br/>สองวันนี้ :'.showsumlog_less(date("Y-m-d", strtotime("first day of this month")));
echo '<br/>เดือนนี้ :'.showsumlog_less(date("Y-m-d", strtotime("first day of this month")));
echo '<br/>รอบสามสิบวัน:'.showsumlog_less(date("Y-m-d", strtotime("-30day")));
echo '<br/>รอบหกสิบวัน:'.showsumlog_less(date("Y-m-d", strtotime("-60day")));
echo '<br/>ปีนี้:'.showsumlog_less(date("Y-m-d", strtotime("first day of January this Year")));
echo '<br/>ปีนี้ที่แล้ว:'.showsumlogl_between(date("Y-m-d", strtotime("first day of january last Year")),date("Y-m-d", strtotime("first day of January this Year")));
mysql_close($con);
สมัครสมาชิก:
บทความ (Atom)




