 |
sql กับ ODBC(access db) ทุกท่านช่วยด้วยผมปวดกะบานหรือเกิน ไม่เข้าใจจริง ๆ รูปแบบการใช้คำสั่ง sql |
|
 |
|
|
 |
 |
|
เอา code มาหน้านี้มาดูทั้งหมดสิครับ
|
 |
 |
 |
 |
Date :
2010-06-09 15:00:11 |
By :
gogo01 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<?php
$dns='timer_control';
$user='';
$pass='';
$connect=odbc_connect($dns,$user,$pass)or die("Not connecting $Server");
$sql="SELECT userinfo.BADGENUMBER,userinfo.TFirstname,userinfo.TLastname,checkinout.USERID, checkinout.CHECKTIME,checkinout.CHECKTYPE from checkinout
INNER JOIN userinfo ON userinfo.USERID = checkinout.USERID where checkinout.USERID=5522867 AND checkinout.CHECKTYPE=IN ";
$exe=odbc_exec($connect,$sql) or die("ไม่สามารถประมวล คำสั่ง $timer");
$items=1;
while($timer_rs=odbc_fetch_array($exe)){
echo"<tr bgcolor=\"#F8F8F8\">";
echo"<td> $items</td>";
echo"<td> $timer_rs[BADGENUMBER]</td>";
echo"<td> $timer_rs[TFirstname] $timer_rs[TLastname]</td>";
echo"<td> $timer_rs[CHECKTIME]</td>";
echo"<td> $timer_rs[CHECKTIME]</td>";
echo"</tr>";
$items++;
}
odbc_free_result($exe);
?>
|
 |
 |
 |
 |
Date :
2010-06-09 16:47:50 |
By :
david |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|