|
 |
|
ช่วยด้วยครับ update database ไม่ได้เข้า ไม่ขึ้น error ด้วย |
|
 |
|
|
 |
 |
|
update database ไม่ได้แถมไม่ฝ้อง error ด้วยไม่รู้ว่ามันงอนอะไร
Code (PHP)
<?
ob_start();
//เรียกการ connect database
include("inc\DB_Conf.php");
?>
<?
$this_month =date('21-F-Y');
$next_month =date('20-F-Y',strtotime('+1 month'));
$tag_date = (strtotime($next_month)-strtotime($this_month))/ ( 60 * 60 * 24 );
$this_year= date('Y');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?
$d=0;
while ($d<count($tct_id))
{
$e=0;
while ($e<$tag_date)
{
$sql_shift_hour = "select * from project_shift where shift_id ='".$name_list[$tct_id[$d]][$e]."' and pro_id = '$_REQUEST[project_id]'";
$sql_show = mysql_db_query($dbname,$sql_shift_hour);
$row_show = mysql_fetch_array($sql_show);
$s_date=date("Y-m-d", strtotime("+ $e day", strtotime($this_month)));
$new_pk[$d] = $tct_id[$d].$s_date;
//echo $new_pk[$d]." --> ".$tct_id[$d]." --> ".$s_date."--> ".$name_list[$tct_id[$d]][$e]." --> ".$row_show[shift_hour]." --> ".$row_show[shift_min]." --> ".$row_show[break_time_hour]." --> ".$row_show[break_time_min]."<br>";
$sql_insert= "insert into time_stamp_user_detail(pk,tct_id,shift_id,date_shift,year,shift_hour,shift_min,break_time_hour,break_time_min) values('".$new_pk[$d]."','".$tct_id[$d]."','".$name_list[$tct_id[$d]][$e]."','$s_date','$this_year','".$row_show[shift_hour]."','".$row_show[shift_min]."','".$row_show[break_time_hour]."','".$row_show[break_time_min]."'";
$insertQuery = mysql_query($sql_insert);
$e++;
}
$d++;
}
?>
<?
header("Location:timelogin.php");
exit();
?>
</body>
</html>
Tag : PHP, CakePHP

|
|
 |
 |
 |
 |
Date :
2010-07-29 15:52:55 |
By :
ziix |
View :
945 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อันดับเรียก comment header("Location:timelogin.php"); ก่อน
ต่อมาก็ echo $sql_insert;
แล้วก็ copy SQL ไปดูที่ phpmyadmin
|
 |
 |
 |
 |
Date :
2010-07-29 16:38:18 |
By :
aknueng |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|