 |
ช่วยดูโค้ดโปรแกรมทีค่ะ เวลาที่นำข้อมขึ้น server แล้วเกิด error แบบนี้ค่ะ Warning: Access denied for user: 'apache@localhost' (Using password: NO) |
|
 |
|
|
 |
 |
|
เวลาที่นำข้อมขึ้น server แล้วเกิด error แบบนี้ค่ะ
Warning: Access denied for user: 'apache@localhost' (Using password: NO) in /home/chai/homepage/officeaddproduct1.php on line 31
Warning: MySQL Connection Failed: Access denied for user: 'apache@localhost' (Using password: NO) in /home/chai/homepage/officeaddproduct1.php on line 31
Warning: MySQL: A link to the server could not be established in /home/chai/homepage/officeaddproduct1.php on line 31
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/chai/homepage/officeaddproduct1.php on line 32
Warning: Access denied for user: 'apache@localhost' (Using password: NO) in /home/chai/homepage/officeaddproduct1.php on line 38
Warning: MySQL Connection Failed: Access denied for user: 'apache@localhost' (Using password: NO) in /home/chai/homepage/officeaddproduct1.php on line 38
Warning: MySQL: A link to the server could not be established in /home/chai/homepage/officeaddproduct1.php on line 38
Warning: mysql_close(): no MySQL-Link resource supplied in /home/chai/homepage/officeaddproduct1.php on line 40
Warning: Access denied for user: 'apache@localhost' (Using password: NO) in /home/chai/homepage/officeaddproduct1.php on line 46
Warning: MySQL Connection Failed: Access denied for user: 'apache@localhost' (Using password: NO) in /home/chai/homepage/officeaddproduct1.php on line 46
Warning: MySQL: A link to the server could not be established in /home/chai/homepage/officeaddproduct1.php on line 46
Warning: mysql_close(): no MySQL-Link resource supplied in /home/chai/homepage/officeaddproduct1.php on line 48
Warning: Access denied for user: 'apache@localhost' (Using password: NO) in /home/chai/homepage/officeaddproduct1.php on line 54
Warning: MySQL Connection Failed: Access denied for user: 'apache@localhost' (Using password: NO) in /home/chai/homepage/officeaddproduct1.php on line 54
Warning: MySQL: A link to the server could not be established in /home/chai/homepage/officeaddproduct1.php on line 54
Warning: mysql_close(): no MySQL-Link resource supplied in /home/chai/homepage/officeaddproduct1.php on line 56
Warning: Access denied for user: 'apache@localhost' (Using password: NO) in /home/chai/homepage/officeaddproduct1.php on line 62
Warning: MySQL Connection Failed: Access denied for user: 'apache@localhost' (Using password: NO) in /home/chai/homepage/officeaddproduct1.php on line 62
Warning: MySQL: A link to the server could not be established in /home/chai/homepage/officeaddproduct1.php on line 62
Warning: mysql_close(): no MySQL-Link resource supplied in /home/chai/homepage/officeaddproduct1.php on line 64
Warning: Access denied for user: 'apache@localhost' (Using password: NO) in /home/chai/homepage/officeaddproduct1.php on line 70
Warning: MySQL Connection Failed: Access denied for user: 'apache@localhost' (Using password: NO) in /home/chai/homepage/officeaddproduct1.php on line 70
Warning: MySQL: A link to the server could not be established in /home/chai/homepage/officeaddproduct1.php on line 70
Warning: mysql_close(): no MySQL-Link resource supplied in /home/chai/homepage/officeaddproduct1.php on line 72
Warning: Access denied for user: 'apache@localhost' (Using password: NO) in /home/chai/homepage/officeaddproduct1.php on line 78
Warning: MySQL Connection Failed: Access denied for user: 'apache@localhost' (Using password: NO) in /home/chai/homepage/officeaddproduct1.php on line 78
Warning: MySQL: A link to the server could not be established in /home/chai/homepage/officeaddproduct1.php on line 78
Warning: mysql_close(): no MySQL-Link resource supplied in /home/chai/homepage/officeaddproduct1.php on line 80
ส่วนนี้เป็นโค้ดที่เขียนขึ้นนะค่ะ
<?
################# Database Configuration ##################
// include("config.inc.php");
$hostname = "aaaa"; # ชื่อServer (สมมุติเอานะค่ะเพราะบอกไม่ได้)
$user = "chai"; # username Database
$password = ""; # password Database
$dbname = "chaicharoen"; # Database
$db_conn = mysql_connect($hostname,$user,$password) or die ("ไม่สามารถติดต่อฐานข้อมูลได้ 1");
mysql_select_db($dbname,$db_conn) or die ("ไม่สามารถติดต่อฐานข้อมูลได้2");
If (!$cus_name){
echo "<br><br><center><font color=#FF0000><b>ไม่ได้กรอกชื่อลุกค้า</b></font></center><br>";
//echo "<meta http-equiv=refresh content=3;URL=addproduct.php>";
}else{
// เพิ่มข้อมูลรายชื่อลูกค้า
//$sql = "insert into user (name) values ('".$CUSTOMER_NAME."')";
$date_out = $y_date."-".$m_date."-".$d_date;
$date_time = (date("Y") + 543) . date("-m-d G:i:s");
$sql = "insert into officeaddpro(date_time,date_out,cus_name,last_name,type_product,c_brand,pro_model,serial1,typepro,inpro,varranty,cus_address,home_tel,work_tel,tel,name_in,name_out,comment) values ('".$date_time."','".$date_out."','".$cus_name."','".$last_name."','".$type_product."','".$c_brand."','".$pro_model."','".$serial1."','".$typepro."','".$inpro."','".$varranty."','".$cus_address."','".$pro_tel1."','".$pro_tel2."','".$pro_tel3."','".$name_in."','".$name_out."','".$comment."')";
$dbquery = mysql_query($sql);
// $result = mysql_fetch_array($dbquery);
mysql_close();
//เพิ่มข้อมูลรายชื่อลูกค้าลงDatabase
$chk_id = "select id from officeaddpro order by id DESC ";
$chk_id_re = mysql_db_query($dbname,$chk_id);
$id_re = mysql_fetch_row( $chk_id_re );
$id = $id_re[0]; // ä´é¤èÒ id ÊØ´·éÒ¨ҡ Database à¡çºäÇéã¹µÑÇá»Ã $id
//เพิ่มข้อมูลรายชื่อลูกค้าลงDatabase
If($cpu){
$sql = "insert into officedetials1(pro_id,product_name,description) values ('".$id."','".$cpu."','".$cpu1."')";
$dbquery = mysql_query($sql);
// $result = mysql_fetch_array($dbquery);
mysql_close();
}
//เพิ่มข้อมูลรายชื่อลูกค้าลงDatabase
If($ram){
$sql = "insert into officedetials1(pro_id,product_name,description) values ('".$id."','".$ram."','".$ram1."".$ram2."')";
$dbquery = mysql_query($sql);
// $result = mysql_fetch_array($dbquery);
mysql_close();
}
//เพิ่มข้อมูลรายชื่อลูกค้าลงDatabase
If($hdd){
$sql = "insert into officedetials1(pro_id,product_name,description) values ('".$id."','".$hdd."','".$hdd1."".$hdd2."')";
$dbquery = mysql_query($sql);
// $result = mysql_fetch_array($dbquery);
mysql_close();
}
//เพิ่มข้อมูลรายชื่อลูกค้าลงDatabase
If($fdd){
$sql = "insert into officedetials1(pro_id,product_name,description) values ('".$id."','".$fdd."','".$fdd1."')";
$dbquery = mysql_query($sql);
// $result = mysql_fetch_array($dbquery);
mysql_close();
}
//เพิ่มข้อมูลรายชื่อลูกค้าลงDatabase
If($agp){
$sql = "insert into officedetials1(pro_id,product_name,description) values ('".$id."','".$agp."','".$agp1."".$agp2."')";
$dbquery = mysql_query($sql);
// $result = mysql_fetch_array($dbquery);
mysql_close();
}
//เพิ่มข้อมูลรายชื่อลูกค้าลงDatabase
If($sound){
$sql = "insert into officedetials1(pro_id,product_name,description) values ('".$id."','".$sound."','".$sound1."".$sound2."')";
$dbquery = mysql_query($sql);
// $result = mysql_fetch_array($dbquery);
mysql_close();
}
echo "<br><center><font color=\"#FF0000\"><b><A HREF=\"officeaddpro.php?id=$id\">พิมพ์ข้อมูล</A></font></center><br>";
}
?>
Tag : - - - -
|
|
 |
 |
 |
 |
Date :
28 Sep 2547 17:11:07 |
By :
kidmaioox |
View :
4828 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
น่าจะเป็นที่ตรงส่วนนี้อ่ะครับ
$host ="ชื่อhostที่ถูก";
$user= "ชื่อผู้ใช้ที่ถูก";
$pwd="ชื่อpassที่ถูก";
$db="ชื่อฐานข้อมูลที่ถูก";
|
 |
 |
 |
 |
Date :
28 Sep 2547 20:39:37 |
By :
shakid |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
// include("config.inc.php");
$hostname = "aaaa"; # ชื่อServer (สมมุติเอานะค่ะเพราะบอกไม่ได้)
$user = "chai"; # username Database
$password = ""; # password Database
$dbname = "chaicharoen"; # Database
มีปัญหาเกี่ยวกับการ Config ครับ
จากที่ดู Error น่าจะ Error ที่ user และ password ครับ
|
 |
 |
 |
 |
Date :
29 ก.ย. 2547 11:06:37 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|