 |
ปรึกษาหน่อยค่ะ เขียนเว็บ php ให้ user ใช้งาน ใช้ไปสักพัก database ค้าง |
|
 |
|
|
 |
 |
|
ถ้าเปิด connection แบบ persistence จะมีผลครับ ลองดูว่าเชื่อมต่อด้วยฟังก์ชั่นอะไร
มีคำประมาณ _pconnect อยู่ในชื่อฟังก์ชั่นหรือเปล่า
|
 |
 |
 |
 |
Date :
2013-06-05 10:24:40 |
By :
cookiephp |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อันนี้คือโค๊ด ติดต่อฐานข้อมูล ชื่อไฟล์ dbcon.php
Code (PHP)
$db = mysql_connect('localhost', 'root', 'root');
mysql_query("Use statistic_zone");
mysql_query("SET NAMES UTF8");
if(mysql_errno())
{
echo "Can't connect to MySQL. Error Message was : ".mysql_error();
exit;
}
เวลาเรียกใช้
Code (PHP)
require_once('dbcon.php');
|
 |
 |
 |
 |
Date :
2013-06-05 10:27:00 |
By :
Nicorobin |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อืม ก็เชื่อมต่อแบบปกติ
งั้นอยู่ที่โค้ดทั้งหมดแล้วล่ะครับ ต้องขอดู
|
 |
 |
 |
 |
Date :
2013-06-05 10:29:04 |
By :
cookiephp |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แค่ 2 คนนี่แปลกมากเลยครับ 
|
 |
 |
 |
 |
Date :
2013-06-05 10:30:52 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ให้ รีสตาร์ท Service ทั้ง Apache และ Mysql ใหม่ครับ
หรือไม่ก็ดูที่ error.log ดูครับ ว่าเพราะอะไร
บางที Service อาจโดนปิดอัตโนมัติเพราะเหตุผลบางอย่างของ OS ก็เป็นไปได้ครับ
|
 |
 |
 |
 |
Date :
2013-06-05 10:37:04 |
By :
deawx |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
นั่นสิค่ะ แค่สองคน ก็งงว่าเป็นเพราะอะไร
นี้โค๊ดทั้งหมดค่ะ
Search.php
Code (PHP)
<form id="form2" name="form2" method="post" action="<? echo $PHP_SELF ?>">
<p align="center">ที่อยู่อาศัย ณ บ้านเลขที่
<?
$id=$_POST['select'];
$id1=$_GET['id'];
$select=fcselect_dis("DISTINCT id,home_id,vi_id,home,division,district","village");
?>
<select name="select" id="select">
<?
while($rows = mysql_fetch_array($select))
{
?>
<option value="<?=$rows["id"]?>" <? if($id1==$rows["id"]){ echo "selected"; } ?>><?= $rows['home_id']." หมู่ ". $rows['vi_id']." บ้าน ".$rows['home']." ตำบล ".$rows['division']." อำเภอ ".$rows['district']?> </option>
<?
}
?>
</select>
<input type="submit" name="search" id="button" value=" ค้นหา " />
</p>
</form>
<?
if($_POST['search']!=""){
echo "<script language=javascript>location.href='$PHP_SELF?id=$id'</script>";
}
?>
หน้าเพิ่มข้อมูล
Code (PHP)
ข้อที่ 13 <span class="style5">เครื่องยนต์ตัดหญ้า</span> </h1>
<p align="center"><? include "search.php"; ?></p>
<?
if($_GET['id'] !=""){
?>
<form action="insert_mac_m.php" method="post" name="frmMain" class="sidemenu" id="frmMain" >
<table width="95%" border="0" align="center" id="myTbl">
<tr id="firstTr">
<td height="28" ><input name="id" type="text" id="id" style="display:none" value="<?=$_GET['id'];?>"/> <div align="left"><span class="style5">เครื่องยนต์ตัดหญ้า
<select name="mac_type[]" id="mac_type[]">
<option value="เครื่องยนต์ตัดหญ้าแบบเดินตาม">เครื่องยนต์ตัดหญ้าแบบเดินตาม</option>
<option value="เครื่องยนต์ตัดหญ้าแบบสายสะพาย">เครื่องยนต์ตัดหญ้าแบบสายสะพาย</option>
<option>อื่น ๆ</option>
</select>
<label>
<input type="text" name="mac_detail[]" id="mac_detail[]" />
</label>
จำนวน
<input type="text" name="mac_qty[]" id="mac_qty[]" />
<label>
<select name="unit[]" id="unit[]">
<option value="เครื่อง">เครื่อง</option>
</select>
</label>
</span></div></td>
</tr>
</table>
<table width="95%" border="0" align="center">
<tr>
<td> </td>
<td > </td>
<td > </td>
<td > </td>
<tr>
<td width="22%"> </td>
<td ><span class="style5 style5">
<button id="addRow" type="button"> + </button>
<button id="removeRow" type="button"> - </button>
</span> </td>
<td ><span class="style5 style5"> </span></td>
<td ><span class="style5 style5"> </span></td>
<tr>
<td> </td>
<td width="30%"><div align="center"><span class="style5">
<input type="submit" name="save" id="button2" value=" บันทึก " />
</span></div></td>
<td width="30%"><div align="center"><span class="style5">
<input type="reset" name="cancel" id="button3" value=" ยกเลิก " onclick="location.href='add_mac_l.php?id=<?=$_GET['id'];?>'"/>
</span></div></td>
<td width="18%"> </td>
</tr>
</table>
</form>
<?
$tb="mac_mowing";
$con="id='".$_GET['id']."'";
$show=fcselectw($tb,$con);
$num_rows=mysql_num_rows($show);
if($num_rows!=0){
?>
</p>
<table width="95%" border="0" class="tableindex">
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td width="40%"> </td>
<td width="19%"> </td>
<td width="24%"> </td>
<td width="17%"><div align="left"></div></td>
</tr>
<?
while($rows = mysql_fetch_array($show))
{
?>
<tr>
<td><div align="left"><span class="style5"> เครื่องตัดหญ้า : <?php echo $rows['mac_type']; ?></span></div></td>
<td><div align="left"><span class="style5"> <?php echo $rows['mac_detail']; ?></span></div></td>
<td><div align="left"><span class="style5">จำนวน : <?=$rows['mac_qty'];?> <?=$rows['unit'];?></span></div></td>
<td><a href="del_tool_dose.php?num=<?=$rows['num'];?>" target="<?=$rows['num'];?>" class="style5" onclick="return confirm('ยื่นยันการลบข้อมูล')"><strong><img src="images/delete-icon.png" width="16" height="16" /></strong></a></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<?
}
?>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<?
}
}
?>
หน้า Insert
Code (PHP)
<?
require_once('dbcon.php');
require_once('function.php');
for($i=0;$i<count($_POST['mac_type']);$i++){
if(trim($_POST["mac_type"][$i]) != ""){
$tb="mac_mowing (id,mac_type,mac_detail,mac_qty,unit)";
$value="'".$_POST['id']."','".$_POST['mac_type'][$i]."','".$_POST['mac_detail'][$i]."','".$_POST['mac_qty'][$i]."','".$_POST['unit'][$i]."'";
$add_db=fcinsertrecord($tb,$value);
if(!$add_db){
echo "ไม่สามารถเพิ่มข้อมูลได้กรุณาติดต่อผู้ดูแลระบบ";
}
}
}
echo "<script language=javascript>location.href='add_mac_l.php?id=$id'</script>";
?>
รบกวนด้วยนะค่ะ
|
 |
 |
 |
 |
Date :
2013-06-05 10:37:07 |
By :
Nicorobin |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
งืม ไม่มีจุดที่เกี่ยวข้องเลยครับ (แต่จริงๆ จุดที่เกี่ยวของอาจจะอยู่ใน function.php ก็ได้)
อาจจะเป็นแบบที่คุณ deawx ว่านะครับ
ลองทำตามคำแนะนำก่อนเลยครับ
|
 |
 |
 |
 |
Date :
2013-06-05 10:40:58 |
By :
cookiephp |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
รีสตาร์ท Apache และ Mysql แล้ว พอใช้ไปสักพักก็เป็นอีกค่ะ
|
 |
 |
 |
 |
Date :
2013-06-05 15:26:26 |
By :
Nicorobin |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ดูใน Log ของ MySQL ครับ
|
 |
 |
 |
 |
Date :
2013-06-05 15:28:31 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ช่วยดูหน่วยค่ะ
ERROR.LOG
Code
[Wed Jun 05 00:07:27 2013] [error] [client 65.55.215.93] File does not exist: E:/xampp/htdocs/robots.txt
[Wed Jun 05 00:57:36 2013] [error] [client 157.56.93.201] File does not exist: E:/xampp/htdocs/robots.txt
[Wed Jun 05 01:44:35 2013] [error] [client 199.30.20.56] File does not exist: E:/xampp/htdocs/robots.txt
[Wed Jun 05 02:12:07 2013] [error] [client 65.55.215.106] File does not exist: E:/xampp/htdocs/robots.txt
[Wed Jun 05 02:29:20 2013] [error] [client 199.30.16.22] File does not exist: E:/xampp/htdocs/robots.txt
[Wed Jun 05 02:53:13 2013] [error] [client 65.55.215.79] File does not exist: E:/xampp/htdocs/robots.txt
[Wed Jun 05 03:04:17 2013] [error] [client 65.55.215.81] File does not exist: E:/xampp/htdocs/robots.txt
[Wed Jun 05 03:06:15 2013] [error] [client 65.55.215.37] File does not exist: E:/xampp/htdocs/robots.txt
[Wed Jun 05 04:21:01 2013] [error] [client 65.55.215.58] File does not exist: E:/xampp/htdocs/robots.txt
[Wed Jun 05 04:43:21 2013] [error] [client 157.56.92.159] File does not exist: E:/xampp/htdocs/robots.txt
[Wed Jun 05 04:44:26 2013] [error] [client 157.56.92.159] File does not exist: E:/xampp/htdocs/web/attachments/113_promote.doc.doc
[Wed Jun 05 13:24:25 2013] [error] [client 66.249.77.218] File does not exist: E:/xampp/htdocs/robots.txt
[Wed Jun 05 13:28:00 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Company-History-over.gif, referer: http://research.pbru.ac.th/e-research/
[Wed Jun 05 13:28:00 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Technology-over.gif, referer: http://research.pbru.ac.th/e-research/
[Wed Jun 05 13:28:00 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Development-over.gif, referer: http://research.pbru.ac.th/e-research/
[Wed Jun 05 13:28:00 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Research-over.gif, referer: http://research.pbru.ac.th/e-research/
[Wed Jun 05 13:28:00 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/New-Products-over.gif, referer: http://research.pbru.ac.th/e-research/
[Wed Jun 05 13:28:00 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Equipment-over.gif, referer: http://research.pbru.ac.th/e-research/
[Wed Jun 05 13:28:00 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Careers-over.gif, referer: http://research.pbru.ac.th/e-research/
[Wed Jun 05 13:28:00 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Info-over.gif, referer: http://research.pbru.ac.th/e-research/
[Wed Jun 05 13:28:00 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Testimonials-over.gif, referer: http://research.pbru.ac.th/e-research/
[Wed Jun 05 13:28:07 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Company-History-over.gif, referer: http://research.pbru.ac.th/e-research/res.php
[Wed Jun 05 13:28:07 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Technology-over.gif, referer: http://research.pbru.ac.th/e-research/res.php
[Wed Jun 05 13:28:07 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Development-over.gif, referer: http://research.pbru.ac.th/e-research/res.php
[Wed Jun 05 13:28:07 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Research-over.gif, referer: http://research.pbru.ac.th/e-research/res.php
[Wed Jun 05 13:28:07 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/New-Products-over.gif, referer: http://research.pbru.ac.th/e-research/res.php
[Wed Jun 05 13:28:07 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Equipment-over.gif, referer: http://research.pbru.ac.th/e-research/res.php
[Wed Jun 05 13:28:07 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Careers-over.gif, referer: http://research.pbru.ac.th/e-research/res.php
[Wed Jun 05 13:28:07 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Info-over.gif, referer: http://research.pbru.ac.th/e-research/res.php
[Wed Jun 05 13:28:07 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Testimonials-over.gif, referer: http://research.pbru.ac.th/e-research/res.php
[Wed Jun 05 13:28:16 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Company-History-over.gif, referer: http://research.pbru.ac.th/e-research/select_year.php?con_type=3&vh=3
[Wed Jun 05 13:28:16 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Technology-over.gif, referer: http://research.pbru.ac.th/e-research/select_year.php?con_type=3&vh=3
[Wed Jun 05 13:28:16 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Development-over.gif, referer: http://research.pbru.ac.th/e-research/select_year.php?con_type=3&vh=3
[Wed Jun 05 13:28:16 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Research-over.gif, referer: http://research.pbru.ac.th/e-research/select_year.php?con_type=3&vh=3
[Wed Jun 05 13:28:16 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/New-Products-over.gif, referer: http://research.pbru.ac.th/e-research/select_year.php?con_type=3&vh=3
[Wed Jun 05 13:28:16 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Equipment-over.gif, referer: http://research.pbru.ac.th/e-research/select_year.php?con_type=3&vh=3
[Wed Jun 05 13:28:16 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Careers-over.gif, referer: http://research.pbru.ac.th/e-research/select_year.php?con_type=3&vh=3
[Wed Jun 05 13:28:16 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Info-over.gif, referer: http://research.pbru.ac.th/e-research/select_year.php?con_type=3&vh=3
[Wed Jun 05 13:28:16 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Testimonials-over.gif, referer: http://research.pbru.ac.th/e-research/select_year.php?con_type=3&vh=3
[Wed Jun 05 13:28:28 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Company-History-over.gif, referer: http://research.pbru.ac.th/e-research/res.php
[Wed Jun 05 13:28:28 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Technology-over.gif, referer: http://research.pbru.ac.th/e-research/res.php
[Wed Jun 05 13:28:28 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Development-over.gif, referer: http://research.pbru.ac.th/e-research/res.php
[Wed Jun 05 13:28:28 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Research-over.gif, referer: http://research.pbru.ac.th/e-research/res.php
[Wed Jun 05 13:28:28 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Equipment-over.gif, referer: http://research.pbru.ac.th/e-research/res.php
[Wed Jun 05 13:28:28 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/New-Products-over.gif, referer: http://research.pbru.ac.th/e-research/res.php
[Wed Jun 05 13:28:28 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Careers-over.gif, referer: http://research.pbru.ac.th/e-research/res.php
[Wed Jun 05 13:28:28 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Info-over.gif, referer: http://research.pbru.ac.th/e-research/res.php
[Wed Jun 05 13:28:28 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Testimonials-over.gif, referer: http://research.pbru.ac.th/e-research/res.php
[Wed Jun 05 13:28:30 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Company-History-over.gif, referer: http://research.pbru.ac.th/e-research/select_year.php?con_type=4&budget=4
[Wed Jun 05 13:28:30 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Technology-over.gif, referer: http://research.pbru.ac.th/e-research/select_year.php?con_type=4&budget=4
[Wed Jun 05 13:28:30 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Development-over.gif, referer: http://research.pbru.ac.th/e-research/select_year.php?con_type=4&budget=4
[Wed Jun 05 13:28:30 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Research-over.gif, referer: http://research.pbru.ac.th/e-research/select_year.php?con_type=4&budget=4
[Wed Jun 05 13:28:30 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/New-Products-over.gif, referer: http://research.pbru.ac.th/e-research/select_year.php?con_type=4&budget=4
[Wed Jun 05 13:28:30 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Equipment-over.gif, referer: http://research.pbru.ac.th/e-research/select_year.php?con_type=4&budget=4
[Wed Jun 05 13:28:30 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Careers-over.gif, referer: http://research.pbru.ac.th/e-research/select_year.php?con_type=4&budget=4
[Wed Jun 05 13:28:30 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Info-over.gif, referer: http://research.pbru.ac.th/e-research/select_year.php?con_type=4&budget=4
[Wed Jun 05 13:28:30 2013] [error] [client 125.27.164.26] File does not exist: E:/xampp/htdocs/e-research/images/Testimonials-over.gif, referer: http://research.pbru.ac.th/e-research/select_year.php?con_type=4&budget=4
[Wed Jun 05 13:43:33 2013] [error] [client 199.30.16.36] File does not exist: E:/xampp/htdocs/robots.txt
[Wed Jun 05 14:02:33 2013] [warn] pid file E:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Wed Jun 05 14:02:33 2013] [notice] Apache/2.2.9 (Win32) DAV/2 mod_ssl/2.2.9 OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.6 configured -- resuming normal operations
[Wed Jun 05 14:02:33 2013] [notice] Server built: Jun 14 2008 19:02:12
[Wed Jun 05 14:02:33 2013] [notice] Parent: Created child process 1820
[Wed Jun 05 14:02:34 2013] [notice] Child 1820: Child process is running
[Wed Jun 05 14:02:34 2013] [notice] Child 1820: Acquired the start mutex.
[Wed Jun 05 14:02:34 2013] [notice] Child 1820: Starting 250 worker threads.
[Wed Jun 05 14:02:34 2013] [notice] Child 1820: Starting thread to listen on port 80.
[Wed Jun 05 14:02:34 2013] [notice] Child 1820: Starting thread to listen on port 443.
[Wed Jun 05 14:05:20 2013] [error] [client 157.55.35.109] File does not exist: E:/xampp/htdocs/robots.txt
[Wed Jun 05 14:35:57 2013] [error] [client 199.30.16.24] File does not exist: E:/xampp/htdocs/robots.txt
[Wed Jun 05 14:46:06 2013] [error] [client 66.249.74.229] File does not exist: E:/xampp/htdocs/web/attachments/209_farther.pdf
[Wed Jun 05 14:46:50 2013] [error] [client 157.55.32.106] File does not exist: E:/xampp/htdocs/web/attachments/142_Program_28-05-54.pdf
|
 |
 |
 |
 |
Date :
2013-06-05 15:59:25 |
By :
Nicorobin |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อันนี้มันของ Apache หรือเปล่าครับ มีของ MySQL ไหม๊ครับ
|
 |
 |
 |
 |
Date :
2013-06-05 16:01:40 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|