|
 |
|
ช่วยดูโค้ดแก้ไขรูปให้หน่อยค่ะ พอแก้ไขแล้วรูปไม่ก็อบลงฐานค่ะ |
|
 |
|
|
 |
 |
|
ช่วยดูโค้ดแก้ไขรูปให้หน่อยค่ะ พอแก้ไขแล้วรูปไม่ก็อบลงฐานค่ะ แต่ข้อมูลอื่นลงหมดเลย ชื่อไฟล์รูปก้อลงนะค่ะ แต่รูปไม่ลงโฟลเดอร์นะค่ะ
ช่วยที่นะค่ะ แก้แล้วม่ายได้อ่ะค่ะ
Code (PHP)
if($_POST[edit])
{
include("../config/connection.php");
$tb=student;
$s_id=$_POST["s_id"];
$citizen_id=$_POST["citizen_id"];
//echo "$s_id,$citizen_id";
$ac_year=$_POST["ac_year"];
$st_name=$_POST["st_name"];
$st_lname=$_POST["st_lname"];
$sex=$_POST["sex"];
$blood=$_POST["blood"];
$religion=$_POST["religion"];
$nation=$_POST["nation"];
$dep_id=$_POST["dep_id"];
$group_id=$_POST["group_id"];
$b_date=$_POST["b_date"];
$add1=$_POST["add1"];
$add2=$_POST["add2"];
$email=$_POST["email"];
$tel=$_POST["tel"];
$f_name=$_POST["f_name"];
$m_name=$_POST["m_name"];
$p_name=$_POST["p_name"];
$p_tel=$_POST["p_tel"];
$gpa=$_POST["gpa"];
$status=$_POST["status"];
$st_date = date("Y-m-d H:i:s");
$st_log="T001";
$tb=student;
$sql="update student set citizen_id='$citizen_id',ac_year='$ac_year', st_name='$st_name',st_lname='$st_lname',sex='$sex', blood='$blood',religion='$religion',nation='$nation',dep_id='$dep_id', group_id='$group_id',b_date='$b_date',add1='$add1',add2='$add2', email='$email',tel='$tel',f_name='$f_name',m_name='$m_name', p_name='$p_name',p_tel='$p_tel',gpa='$gpa',status='$status',off_id='$off_id',st_date='$st_date',st_log='$st_log' where s_id='$s_id' ";
$dbquery = mysql_db_query($db, $sql);
if(!empty($file1))
{
$path="../picture";
@copy( $file1 ,"$path/$file1");
$sql= "update student set Picture='$file1' where s_id='$s_id'";
$dbquery = mysql_db_query($db, $sql);
}
echo"<script language='JavaScript'>";
echo"alert('แก้ไขข้อมูลเรียบร้อยแล้ว');";
echo"window.location='addstu.php';";
echo"</script>";
}
Tag : PHP

|
|
 |
 |
 |
 |
Date :
2011-01-12 00:44:17 |
By :
aumaum |
View :
1252 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอาไปไว้ในส่วนไหนค่ะ แก้ตรงไหนอ่ะค่ะ งง
|
 |
 |
 |
 |
Date :
2011-01-12 11:38:54 |
By :
aumaum |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|