我已经尝试过与我类似的其他答案,但徒劳无功。
这是代码。
<?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