这是我的代码
<?php
include('admin/class.php');
这是数据库连接
$link = mysqli_connect("localhost", "root", "", "timesheet1234");
这里正在对我的保存按钮进行操作
if(isset($_POST['save']))
{
$sel=@$_POST['selpro'];
$mon=@$_POST['mon'];
$tue=@$_POST['tue'];
$wed=@$_POST['wed'];
$thu=@$_POST['thu'];
$fri=@$_POST['fri'];
$sat=@$_POST['sat'];
$sun=@$_POST['sun'];
这就是问题发生的地方
if(isset($_SESSION['user']))
{
echo "session user";
它不接受mysqli
$stmt = mysqli_prepare($link,"UPDATE empdaytimesheet SET
`projectcode`='$sel',`mon`='$mon',`tue`='$tue',`wed`='$wed',
`thu`='$thu',`fri`='$fri',`sat`='$sat',`sun`='$sun' where
`username`='".$_SESSION['user']."'");
mysqli_stmt_bind_param($stmt,"siiiiiii", $sel,$mon,$tue,$wed,$thu,$fri,$sat,$sun);
$res= mysqli_stmt_execute($stmt);
它没有达到这种状态
if($res){
echo "<script type='text/javascript'>";
echo "alert('TimeSheet Saved..!')";
echo "</script>";
echo "<script type='text/javascript'>";
echo "window.location='my_timesheet.php'";
echo "</script>";
}
相反,它执行以下操作:
else {
echo "<script type='text/javascript'>";
echo "alert('Some Error Occured ! Retry..!')";
echo "</script>";
echo "<script type='text/javascript'>";
echo "window.location='my_timesheet.php'";
echo "</script>";
}
}
}
?>