|
|
|
Fatal error: Maximum execution time of 60 seconds exceeded in |
|
|
|
|
|
|
|
มันขึ้น ว่าFatal error: Maximum execution time of 60 seconds exceeded in C:\AppServ\www\Alumni\test2.php on line 42
นี่คือส่วนที่ error อะนะ
<?php
@session_start();
$username=$_SESSION['username'];
$password=$_SESSION['password'];
if(!isset($_SESSION['username']) and !isset($_SESSION['password'])){
header ("Location: L041n.php") ;
exit();
} ?>
<?php date_default_timezone_set('Asia/Bangkok');?>
<?php
//¡Ó˹´ª×èÍ host/username/password/databasename ¡è͹
mysql_connect('localhost','root','root') or die(mysql_error());
mysql_select_db('kuasc') or die(mysql_error());
//create test data
/* $r = mysql_query("SHOW TABLES LIKE 'order_test'");
if (mysql_num_rows($r) == 0) {
mysql_query(
'CREATE TABLE `order_test` ('.
'`uid` int NOT NULL AUTO_INCREMENT,'.
'`id` varchar(10) NOT NULL,'.
'PRIMARY KEY (`id`), UNIQUE KEY(`uid`)'.
')'
) or die(mysql_error());
echo 'create table order_test successfully.<br>';
} */
@session_start();
$username=$_SESSION['username'];
//$password=$_SESSION['password'];
if ($username=='sahachon') {
$r_onn = ('AL1');
$c_yearn = date('Y');
$rn = mysql_query("SELECT id FROM `test` WHERE uid=(SELECT MAX(uid) FROM `test` WHERE id LIKE '$c_yearn%')");
$n_numbern = mysql_num_rows($rn) ? substr(mysql_result($rn,0),5) : 0;
//run query insert ä»àÃ×èÍÂæ ¨¹¡ÇèÒ¨ÐäÁè error 1062 (error key «éÓ)
do {
$n_ida = $c_yearn.$r_onn.sprintf("%05d", ++$n_numbern);
$sqln = "INSERT INTO test(id) VALUES('$n_ida')";
mysql_query($sqln);
}
while (mysql_errno() == 1062); } else if ($username=='noppadon') {
$r_onn = ('AL2');
$c_yearn = date('Y');
$rn = mysql_query("SELECT id FROM `test2` WHERE uid=(SELECT MAX(uid) FROM `test2` WHERE id LIKE '$c_yearn%')");
$n_numbern = mysql_num_rows($rn) ? substr(mysql_result($rn,0),6) : 0;
//run query insert ä»àÃ×èÍÂæ ¨¹¡ÇèÒ¨ÐäÁè error 1062 (error key «éÓ)
do {
$n_ida = $c_yearn.$r_onn.sprintf("%05d", ++$n_numbern);
$sql = "INSERT INTO test2(id) VALUES('$n_ida')";
mysql_query($sql);
}
while (mysql_errno() == 20000); } else if ($username=='rithai') {
$r_onn = ('AL3');
$c_yearn = date('Y');
$rn = mysql_query("SELECT id FROM `test3` WHERE uid=(SELECT MAX(uid) FROM `test3` WHERE id LIKE '$c_yearn%')");
$n_numbern = mysql_num_rows($rn) ? substr(mysql_result($rn,0),5) : 0;
//run query insert ä»àÃ×èÍÂæ ¨¹¡ÇèÒ¨ÐäÁè error 1062 (error key «éÓ)
do {
$n_ida = $c_yearn.$r_onn.sprintf("%05d", ++$n_numbern);
$sqln = "INSERT INTO test3(id) VALUES('$n_ida')";
mysql_query($sqln);
}
while (mysql_errno() == 20000); } else if ($username=='sira') {
$r_on = ('AL4');
$c_year = date('Y');
$r = mysql_query("SELECT id FROM `test4` WHERE uid=(SELECT MAX(uid) FROM `test4` WHERE id LIKE '$c_year%')");
$n_number = mysql_num_rows($r) ? substr(mysql_result($r,0),5) : 0;
//run query insert ä»àÃ×èÍÂæ ¨¹¡ÇèÒ¨ÐäÁè error 1062 (error key «éÓ)
do {
$n_ida = $c_year.$r_on.sprintf("%05d", ++$n_number);
$sql = "INSERT INTO test4(id) VALUES('$n_ida')";
mysql_query($sql);
}
while (mysql_errno() == 20000); } else if ($username=='panormas') {
$r_on = ('AL5');
$c_year = date('Y');
$r = mysql_query("SELECT id FROM `test5` WHERE uid=(SELECT MAX(uid) FROM `test5` WHERE id LIKE '$c_year%')");
$n_number = mysql_num_rows($r) ? substr(mysql_result($r,0),5) : 0;
//run query insert ä»àÃ×èÍÂæ ¨¹¡ÇèÒ¨ÐäÁè error 1062 (error key «éÓ)
do {
$n_ida = $c_year.$r_on.sprintf("%05d", ++$n_number);
$sql = "INSERT INTO test5(id) VALUES('$n_ida')";
mysql_query($sql);
}
while (mysql_errno() == 20000); } else if ($username=='lakkana') {
$r_on = ('AL6');
$c_year = date('Y');
$r = mysql_query("SELECT id FROM `test6` WHERE uid=(SELECT MAX(uid) FROM `test6` WHERE id LIKE '$c_year%')");
$n_number = mysql_num_rows($r) ? substr(mysql_result($r,0),5) : 0;
//run query insert ä»àÃ×èÍÂæ ¨¹¡ÇèÒ¨ÐäÁè error 1062 (error key «éÓ)
do {
$n_ida = $c_year.$r_on.sprintf("%05d", ++$n_number);
$sql = "INSERT INTO test6(id) VALUES('$n_ida')";
mysql_query($sql);
}
while (mysql_errno() == 20000); } else if ($username=='noppon' or $username=='apicha') {
$r_on = ('AL7');
$c_year = date('Y');
$r = mysql_query("SELECT id FROM `test7` WHERE uid=(SELECT MAX(uid) FROM `test7` WHERE id LIKE '$c_year%')");
$n_number = mysql_num_rows($r) ? substr(mysql_result($r,0),5) : 0;
//run query insert ä»àÃ×èÍÂæ ¨¹¡ÇèÒ¨ÐäÁè error 1062 (error key «éÓ)
do {
$n_ida = $c_year.$r_on.sprintf("%05d", ++$n_number);
$sql = "INSERT INTO test7(id) VALUES('$n_ida')";
mysql_query($sql);
}
while (mysql_errno() == 20000); } else if ($username=='wipawadee') {
$r_on = ('AL8');
$c_year = date('Y');
$r = mysql_query("SELECT id FROM `test8` WHERE uid=(SELECT MAX(uid) FROM `test8` WHERE id LIKE '$c_year%')");
$n_number = mysql_num_rows($r) ? substr(mysql_result($r,0),5) : 0;
//run query insert ä»àÃ×èÍÂæ ¨¹¡ÇèÒ¨ÐäÁè error 1062 (error key «éÓ)
do {
$n_ida = $c_year.$r_on.sprintf("%05d", ++$n_number);
$sql = "INSERT INTO test8(id) VALUES('$n_ida')";
mysql_query($sql);
}
while (mysql_errno() == 20000); } else if ($username=='tipat' or $username=='kanin') {
$r_on = ('AL9');
$c_year = date('Y');
$r = mysql_query("SELECT id FROM `test9` WHERE uid=(SELECT MAX(uid) FROM `test9` WHERE id LIKE '$c_year%')");
$n_number = mysql_num_rows($r) ? substr(mysql_result($r,0),5) : 0;
//run query insert ä»àÃ×èÍÂæ ¨¹¡ÇèÒ¨ÐäÁè error 1062 (error key «éÓ)
do {
$n_ida = $c_year.$r_on.sprintf("%05d", ++$n_number);
$sql = "INSERT INTO test9(id) VALUES('$n_ida')";
mysql_query($sql);
}
while (mysql_errno() == 20000); } else if ($username=='umnad' or $username=='kajonsak' or $username=='itsarapong') {
$r_on = ('AL10');
$c_year = date('Y');
$r = mysql_query("SELECT id FROM `test10` WHERE uid=(SELECT MAX(uid) FROM `test10` WHERE id LIKE '$c_year%')");
$n_number = mysql_num_rows($r) ? substr(mysql_result($r,0),5) : 0;
//run query insert ä»àÃ×èÍÂæ ¨¹¡ÇèÒ¨ÐäÁè error 1062 (error key «éÓ)
do {
$n_ida = $c_year.$r_on.sprintf("%05d", ++$n_number);
$sql = "INSERT INTO test10(id) VALUES('$n_ida')";
mysql_query($sql);
}
while (mysql_errno() == 20000); }
//echo $sql;
?>
ยังไงรบกวนช่วยดูหน่อยนะคะ
Tag : - - - -
|
|
|
|
|
|
Date :
2009-12-21 07:34:38 |
By :
leehoon5 |
View :
3798 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
คำถามนี้คุณ Pakrim เคยตอบแล้วน่ะครับ
มันเป็นเพราะ ค่าของ max_execution_time ของคุณกำหนดไว้ที่ 60 วินาที
มันเยอะมากแล้วน่ะครับ
ถ้าจะเพิ่มก็ไปแก้ที่ ไฟล์ php.ini ครับ แล้วเพิ่มเป็น
max_execution_time = 90
แล้วกันนะครับ แต่ปกติแล้ว ก็ 30 ครับ หมายถึง เวลาที่จะปล่อยให้ script คุณ run หนะครับ
ลองตรวจดู script ของคุณดูน่ะครับว่ามันมี Infinity Loop ไหมน่ะครับ เพราะไม่ควรเพิ่ม เวลาการ run ให้สูงอย่างนี้นะครับ
|
|
|
|
|
Date :
2009-12-21 07:58:07 |
By :
debutant |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอเสริมนิดน่ะครับ
set_time_limit(); //เพิ่มบรรทัดนี้ไว้บนสุดของไฟล์ที่ประมวลผลก็ได้ครับ
|
|
|
|
|
Date :
2009-12-21 08:32:06 |
By :
iieszz |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|