나는 이런 종류의 질문을하기 전에 알고 있지만 내가 원하는 것은 intime과 outtime의 시간 차이를 계산하는 것입니다. 내가 초보자 그래서 전문가 모드에서 자신을 얻을 수 없다 "Catchable 치명적인 오류 : 클래스 mysqli_result의 개체는 C : \ wamp \ www \ 실험 사이트 \ time_test.php 라인 (105)에 "시간차를 계산하려면
<?php
$con = mysqli_connect("localhost","root","","testsite") OR die("Could not connect: ".mysqli_error());
if (isset($_POST['isubmit'])) {
// Check the cookie exits or not
if (isset($_COOKIE['uid'])) {
$_COOKIE['uid'];
}
$uid = $_COOKIE['uid'];
echo "Hello user: ".$uid;
$isql = mysqli_query($con, "INSERT INTO `time`(`uid`, `intime`, `date`) VALUES ('$uid',CURTIME(),CURDATE())");
$lid = mysqli_insert_id($con);
echo $lid;
}
if (isset($_POST['osubmit'])) {
if(isset($_COOKIE['uid'])) {
$_COOKIE['uid'];
}
$uid = $_COOKIE['uid'];
$ssql= mysqli_query($con,"SELECT `intime`, `outtime`, `date` FROM `time` WHERE `uid`=".$uid);
while ($row = mysqli_fetch_array($ssql)) {
$intime = $row['intime'];
$outtime= $row['outtime'];
$date = $row['date'];
if(!empty($date)){
$tmp = mysqli_query($con, "SELECT CURTIME()");
$lid = mysqli_insert_id($con);
$temp= strtotime($outtime) - strtotime($intime);
echo $temp;
//below line is line number 105
$usql= "UPDATE `time` SET `outtime`= $tmp,`diff`= '$temp' WHERE `id`=".$lid." AND `uid`=".$uid;
$run = mysqli_query($con, $usql);
if (!$run) {
die("Update database query error: ". mysqli_error());
}
}
}
}
?>
'$ TMP = mysqli_query을 사용할 수의'이 될 수 있습니다 죽이기보다 조금 생각해? 귀하의 MySQL 서버가 귀하의 아파치 서버와 다른 경우가 아니라면 다른 GMT – Brewal
하에 실행되지 않는 한, 필자는 업로드 후 항상 일기장에서 지적한 필요한 것들을 변경 한 것보다 항상 처음으로 로컬 드라이브를 사용하고 있습니다. 이것을 통해 나는 내 컴퓨터에서 시간을 얻으며,이 때 좋았다. 난 그냥 오류에서 제거하고 싶습니다 ... –