 |
Warning: mssql_query() [function.mssql-query]: message: An expression of non-boolean type specified in a context where a condition is expected, near ')'. (severity 15) |
|
 |
|
|
 |
 |
|
ไม่รู้ว่าวงเล็บอันไหนเกิน
Code (PHP)
$sqlcheck = "select I.USERID,I.CHECKTIME,CONVERT(CHAR(8), I.CHECKTIME, 114) AS TimeIN,CONVERT(CHAR(8), O.CHECKTIME, 114) AS TimeOUTS
from (select USERID,CHECKTIME,CONVERT(CHAR(8), CHECKTIME, 114) AS TimeIN from View_Person_Bydate where CHECKTYPE='I' and CONVERT(CHAR(10), CHECKTIME, 23)) I left join (select USERID,CHECKTIME,CONVERT(CHAR(8), CHECKTIME, 114) AS TimeOUTS from View_Person_Bydate where CHECKTYPE='O' and CONVERT(CHAR(10), CHECKTIME, 23)) O on I.UserID=O.UserID
where userid=(select uersid from userinfo where CardNo='".$_POST["citizen_id"]."')
and CONVERT(CHAR(10), CHECKTIME, 23) between '".$_POST["date5"]."' and '".$_POST["date6"]."' order by CHECKTIME asc";
Tag : PHP, HTML/CSS, JavaScript
|
|
 |
 |
 |
 |
Date :
2012-06-25 13:33:25 |
By :
compiak |
View :
1091 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
วงเล็บไม่ได้เกินคับ แต่ว่า syntax ที่ต่อจากวงเล็บปิดสักตัวนึงในนี้อ่ะผิดคับ ลองหาดู
|
 |
 |
 |
 |
Date :
2012-06-25 13:45:03 |
By :
ichiko |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ก็ยังไม่ได้
Warning: mssql_query() [function.mssql-query]: message: Incorrect syntax near the keyword 'and'. (severity 15) in C:\AppServ\www\fingerweb\Finger\checktimework.php on line 189
|
 |
 |
 |
 |
Date :
2012-06-25 16:42:10 |
By :
compiak |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองเอาคำสั่งมาดูหน่อยสิคับ ที่มันเตือนบอกว่าคำสั่งที่อยู่ใกล้ๆ กับคำว่า and ผิดอ่ะคับ
|
 |
 |
 |
 |
Date :
2012-06-25 16:59:00 |
By :
ichiko |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตอบความคิดเห็นที่ : 3 เขียนโดย : ichiko เมื่อวันที่ 2012-06-25 16:59:00
รายละเอียดของการตอบ ::
นี่ครับโค๊ดคำสั่ง
Code (PHP)
<?
$sqlcheck = "select I.USERID,I.CHECKTIME,CONVERT(CHAR(8), I.CHECKTIME, 114) AS TimeIN,CONVERT(CHAR(8), O.CHECKTIME, 114) AS TimeOUTS
from (select USERID,CHECKTIME,CONVERT(CHAR(8), CHECKTIME, 114) AS TimeIN from checkinout where CHECKTYPE='I' and CONVERT(CHAR(10), CHECKTIME, 23)) I left join (select USERID,CHECKTIME,CONVERT(CHAR(8), CHECKTIME, 114) AS TimeOUTS from checkinout where CHECKTYPE='O' and CONVERT(CHAR(10), CHECKTIME, 23)) O on I.UserID=O.UserID
where userid=(select userid from userinfo where CardNo='".$_POST["citizen_id"]."')
and CONVERT(CHAR(10), CHECKTIME, 23) between '".$_POST["date5"]."' and '".$_POST["date6"]."' order by CHECKTIME asc";
$objQueryTemp = mssql_query($sqlcheck) or die ("Error Query [".$sqlcheck."]");
$numrow=mssql_num_rows($objQueryTemp);
if($numrow > 0)
{
?>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<th width="82" class="data_grid_center"><span class="Text_Sarabun_center"> ที่</span></th>
<th width="211" class="data_grid_center"><span class="Text_Sarabun_center">วันที่ทำงาาน</span></th>
<th width="147" class="data_grid_center"><span class="Text_Sarabun_center"> เวลาเข้า </span></th>
<th width="121" class="data_grid_center"><span class="Text_Sarabun_center">เวลาออก</span></th>
<th width="108" class="data_grid_center"><span class="Text_Sarabun_center">หมายเหตุ</span></th>
</tr>
<?
$i=1;
while($i <= $numrow)
{
$result=mysql_fetch_array($objQueryTemp);
$date = date('Y-m-d', strtotime($result[CHECKTIME]));
$DateStamp=$date;
$TimeIn=$result[TimeIN];
$TimeOut=$result[TimeOUTS];
$UserID=$result[USERID];
?>
<tr>
<td class="data_grid_center"><span class="Text_Sarabun_center"> <?=$i ?>
</span></td>
<td class="data_grid_left"><div align="center"><span class="Text_Sarabun_center">
<?= $DateStamp ?>
</span></div></td>
<td class="data_grid_center"><span class="Text_Sarabun_center">
<?= $TimeIn ?>
</span></td>
<td class="data_grid_center"><span class="Text_Sarabun_center">
<?= $TimeOut ?>
</span></td>
<td class="data_grid_center"><span class="Text_Sarabun_center">
</span> </td>
</tr>
<?
$i++;
}
?>
</table>
<?
}
else
echo"<br> <font color=red>ไม่พบ ! </b>";
?
|
 |
 |
 |
 |
Date :
2012-06-25 17:30:21 |
By :
compiak |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|