これが私のコードです
<?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>";
}
}
}
?>