Jump to content

Recommended Posts

4 minutes ago, ginerjm said:

How about creating a timestamp column and placing a single value on your record instead of two values?

I did make the change but still not inserting!

code:

<?php

include('dbcon.php');
include('session.php'); 

	if (isset($_POST["clockin"])){
		
		$query1=mysqli_query($con, "update staff set ClockedIn = -1, indate = CURDATE() where OracleID='$session_id'")or die('Error In Session');
		
		$result=mysqli_query($con, "select * from staff where OracleID='$session_id'")or die('Error In Session');
		$row=mysqli_fetch_array($result);
		
		$oracleid = $row['OracleID'];
		$Name = $row['StaffName'];
		$Des = $row['Des'];
		$sDate = date("Y-m-d H:i:s");
		
		$sql = mysqli_query($con,"INSERT INTO attendance_records (OracleID,Name,Des,ClockingInDate)
		VALUES ('$oracleid','$Name','$Des','$sDate')");
		
		header('location:index.php');
		
	}
?>

Still don't see any new records added

Did you check to see if the first query did an update? 

And what is the column 'indate' defined as?

And did you actually return any rows from the select query? 

And did you then check to see how many rows were inserted?

So many questions that you need to ask of your script.

I solved it. the problem was not with time, something else. Now i have a question, when the timestamp got saved, it shows time -3. my time is 9PM for example, it shows in the DB 6PM. Is it saved that way in the server? if i retrieve the time from server and display it, what will it show? 6PM or my time 9PM?

 

I need to show my zone time, how possible? 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.