我試着與我相似,但徒勞其他的答案。警告:請求mysql_query()預計參數2是資源,在C定的boolean: WAMP WWW pyrll emlhome.php上15線
這是代碼。
<?php
session_start();
$con=isset($_POST['con']);
include("header.php");
include("dbconnection.php");
$logindt = date("Y-m-d");
$qresult=mysql_query("SELECT * FROM attendance WHERE logintime > '$logindt 00:00:00' AND logintime < '$logindt 23:59:59' AND empid ='$_SESSION[emid]'");
$counts = mysql_num_rows($qresult);
$attid = date("Y-m-d h:i:s");
if(isset($_POST["login"]))
{
$insdb ="INSERT INTO attendance(empid,logintime) VALUES ('$_SESSION[emid]','$attid')";
mysql_query($insdb,$con);//line 15
支票isset($ _ SESSION [EMID])isset($ attid) – Ghostman