Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > ตอนนี้ทำ บันทึกประวัติของผู้ป่วย add ชื่อ มาโชว์ได้แล้ว แต่อยากได้คือ คลิกที่ชื่อไหน ก้อสามารถแก้ไขของคนนั้นได้แค่คนเดว



 

ตอนนี้ทำ บันทึกประวัติของผู้ป่วย add ชื่อ มาโชว์ได้แล้ว แต่อยากได้คือ คลิกที่ชื่อไหน ก้อสามารถแก้ไขของคนนั้นได้แค่คนเดว

 



Topic : 074274

Guest




ตอนนี้กำลังทำเว็บสถานีอนามัยอะค่ะ
มีปัญหาอยู่นิดหน่อยค่ะ อยากจะถามพี่ๆๆ


ตอนนี้ทำ บันทึกประวัติของผู้ป่วย add ชื่อ มาโชว์ได้แล้ว แต่อยากได้คือ คลิกที่ชื่อไหน ก้อสามารถแก้ไขของคนนั้นได้แค่คนเดว

77



ตอนนี้ทำแบบ แก้ไขได้ทุกคน อยากได้ พอลิ้งจากชื่อไหนมา ก้อสามารถแก้ของคนนั้นเพียงคนเดียว ต้องเขียนโค้ด edit ยังไงค่ะ
Edit(PHP)
   <?
			  
$host = "localhost";
	$user = "root"; 
	$passwd = "1234"; 
	$dbname = "general";
	$tbname = "patient";
	
mysql_connect($host,$user,$passwd) or die("ติดต่อ Host ไม่ได้");
mysql_select_db($dbname) or die("ติดต่อฐานข้อมูลไม่ได้");

if ($id_patient>0){
mysql_query ("SET NAMES utf8") or die (mysql_errno());
$sql = "UPDATE `general`.`patient` 
SET `name_patient`='$name_patient',

`gender_patient`='$gender_patient',
`age_patient`='$age_patient',
`gblood`='$gblood',
`birthday_patient`='$birthday_patient',
`phone_patient`='$phone_patient',
`address_patient`='$address_patient',
`work_patient`='$work_patient',
`day_patient`='$day_patient',
`check_patient`='$check_patient',
`symptom`='$symptom',
`drug`='$drug',
`arrange`='$arrange',
`docter`='$docter'
WHERE `patient`.`id_patient` ='$id_patient' ;";
mysql_query($sql);
}
mysql_query ("SET NAMES utf8") or die (mysql_errno());
$sql = "SELECT * FROM `patient` ";
$result = mysql_query($sql);
echo"<table width='50%' border='1' bordercolor='#fff'  bgcolor='#34B2C9' ><tr align='center'>



</tr>";
while($row=mysql_fetch_array($result)){
$id_patient= $row["id_patient"];
$name_patient= $row["name_patient"];
$gender_patient = $row["gender_patient"];
$age_patient = $row["age_patient"];
$gblood = $row["gblood"];
$birthday_patient = $row["birthday_patient"];
$phone_patient = $row["phone_patient"];

$address_patient = $row["address_patient"];
$work_patient = $row["work_patient"];
$day_patient = $row["day_patient"];
$check_patient = $row["check_patient"];
$symptom = $row["symptom"];
$drug = $row["drug"];
$arrange = $row["arrange"];
$docter = $row["docter"];



echo "<tr bgcolor='#C6EAF0' align='center'><form id='form1' name='form1' method='post' action='EditPatient.php'>";
echo "<input type='hidden' name='id_patient' value='$id_patient'></td>";
echo"<tr>";
echo"<td> ชื่อ-นามสกุลผู้ป่วย</td>";
echo "<td><input name='name_patient' type='text' value='$name_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>เพศ</td>";
echo "<td><input name='gender_patient' type='text' value='$gender_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>อายุ</td>";
echo "<td><input name='age_patient' type='text' value='$age_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>กรุ๊ปเลือด</td>";
echo "<td><input name='gblood' type='text' value='$gblood'></td>";
echo"<tr>";
echo"<td>วันเกิด</td>";
echo "<td><input name='birthday_patient' type='text' value='$birthday_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>เบอร์โทรศัพท์</td>";
echo "<td><input name='phone_patient' type='text' value='$phone_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>ที่อยู่</td>";
echo "<td><input name='address_patient' type='text' value='$address_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>อาชีพ</td>";
echo "<td><input name='work_patient' type='text' value='$work_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>วันที่รับการรักษา</td>";
echo "<td><input name='day_patient' type='text' value='$day_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>เช็คร่างกาย</td>";
echo "<td><input name='check_patient' type='text' value='$check_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>อาการที่เป็น</td>";
echo "<td><input name='symptom' type='text' value='$symptom'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>ยารักษา</td>";
echo "<td><input name='drug' type='text' value='$drug'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>วันนัด</td>";
echo "<td><input name='arrange' type='text' value='$arrange'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>แพทย์ที่รับผิดชอบ</td>";
echo "<td><input name='docter' type='text' value='$docter'></td>";
echo"</tr>";

echo "<td><input type='submit' name='Edit' id='Edit' value='Edit' onclick=" ?>
"return confirm('คุณแน่ใจว่าต้องการแก้ไขข้อมูลนี้หรือไม่ ? ')" /><? "/>";
echo "</td></form></tr>";
}
?>


เปนดังรูปนี้อะค่ะ

1234



Tag : PHP, MySQL, CakePHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-02-21 18:25:31 By : น้องกัปตัน View : 2486 Reply : 15
 

 

No. 1



โพสกระทู้ ( 2,249 )
บทความ ( 5 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook Hi5 Blogger

Code (PHP)
   <?
			  
$host = "localhost";
	$user = "root"; 
	$passwd = "1234"; 
	$dbname = "general";
	$tbname = "patient";
	
mysql_connect($host,$user,$passwd) or die("ติดต่อ Host ไม่ได้");
mysql_select_db($dbname) or die("ติดต่อฐานข้อมูลไม่ได้");

if ($id_patient>0){
mysql_query ("SET NAMES utf8") or die (mysql_errno());
$sql = "UPDATE `general`.`patient` 
SET `name_patient`='$name_patient',

`gender_patient`='$gender_patient',
`age_patient`='$age_patient',
`gblood`='$gblood',
`birthday_patient`='$birthday_patient',
`phone_patient`='$phone_patient',
`address_patient`='$address_patient',
`work_patient`='$work_patient',
`day_patient`='$day_patient',
`check_patient`='$check_patient',
`symptom`='$symptom',
`drug`='$drug',
`arrange`='$arrange',
`docter`='$docter'
WHERE `patient`.`id_patient` ='$id_patient' ;";
mysql_query($sql);
}
mysql_query ("SET NAMES utf8") or die (mysql_errno());
$sql = "SELECT * FROM `patient` ";
$result = mysql_query($sql);
echo"<table width='50%' border='1' bordercolor='#fff'  bgcolor='#34B2C9' ><tr align='center'>



</tr>";
$row=mysql_fetch_array($result);
$id_patient= $row["id_patient"];
$name_patient= $row["name_patient"];
$gender_patient = $row["gender_patient"];
$age_patient = $row["age_patient"];
$gblood = $row["gblood"];
$birthday_patient = $row["birthday_patient"];
$phone_patient = $row["phone_patient"];

$address_patient = $row["address_patient"];
$work_patient = $row["work_patient"];
$day_patient = $row["day_patient"];
$check_patient = $row["check_patient"];
$symptom = $row["symptom"];
$drug = $row["drug"];
$arrange = $row["arrange"];
$docter = $row["docter"];



echo "<tr bgcolor='#C6EAF0' align='center'><form id='form1' name='form1' method='post' action='EditPatient.php'>";
echo "<input type='hidden' name='id_patient' value='$id_patient'></td>";
echo"<tr>";
echo"<td> ชื่อ-นามสกุลผู้ป่วย</td>";
echo "<td><input name='name_patient' type='text' value='$name_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>เพศ</td>";
echo "<td><input name='gender_patient' type='text' value='$gender_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>อายุ</td>";
echo "<td><input name='age_patient' type='text' value='$age_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>กรุ๊ปเลือด</td>";
echo "<td><input name='gblood' type='text' value='$gblood'></td>";
echo"<tr>";
echo"<td>วันเกิด</td>";
echo "<td><input name='birthday_patient' type='text' value='$birthday_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>เบอร์โทรศัพท์</td>";
echo "<td><input name='phone_patient' type='text' value='$phone_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>ที่อยู่</td>";
echo "<td><input name='address_patient' type='text' value='$address_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>อาชีพ</td>";
echo "<td><input name='work_patient' type='text' value='$work_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>วันที่รับการรักษา</td>";
echo "<td><input name='day_patient' type='text' value='$day_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>เช็คร่างกาย</td>";
echo "<td><input name='check_patient' type='text' value='$check_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>อาการที่เป็น</td>";
echo "<td><input name='symptom' type='text' value='$symptom'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>ยารักษา</td>";
echo "<td><input name='drug' type='text' value='$drug'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>วันนัด</td>";
echo "<td><input name='arrange' type='text' value='$arrange'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>แพทย์ที่รับผิดชอบ</td>";
echo "<td><input name='docter' type='text' value='$docter'></td>";
echo"</tr>";

echo "<td><input type='submit' name='Edit' id='Edit' value='Edit' onclick=" ?>
"return confirm('คุณแน่ใจว่าต้องการแก้ไขข้อมูลนี้หรือไม่ ? ')" /><? "/>";
echo "</td></form></tr>";
?>







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-21 18:59:37 By : Manussawin
 


 

No. 2



โพสกระทู้ ( 2,249 )
บทความ ( 5 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook Hi5 Blogger

ออครับจาก code นี้ตรง link ที่จะคลิกมาเพื่อ Edit ควรจะเช็ตค่าของ id ผู้ป่วยที่เราจะแก้ไขมาด้วยครับ

Ex : <a href='form_edit.php?idedit=<?=ดึงข้อมูลไอดีของผู้ป่วย?>'>แก้ไขข้อมูล</a>

--------------------------
และใน code edit ตรงดึงข้อมูล user ที่จะ edit บรรทัดที่ 34

$sql = "SELECT * FROM `patient` where ฟิลไอดีผู้ป่วย ='$idedit'";
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-21 19:05:44 By : Manussawin
 

 

No. 3

Guest


ตอบความคิดเห็นที่ : 2 เขียนโดย : Manussawin เมื่อวันที่ 2012-02-21 19:05:44
รายละเอียดของการตอบ ::

ไม่ได้อ่ะค่ะ ลองดูให้อีกทีนะค่ะ



โค้ดนี้ใส่เพิ่มเข้าไปในหน้า โชว์
Code (PHP)
echo"<td><a href='EditPatient.php?id_patient=$id_patient'>แก้ไขข้อมูล</a></td>";


เพิ่ม 2อันนี้ไป

$id=$_GET['id_patient'];
$sql = "SELECT * FROM `patient` where id_patient='$id'";

แล้วก้อเปลี่ยนจากอันเดิมเป็นอันนี้
$row=mysql_fetch_array($result);{


ผล คือ พอคลิกคำว่า แก้ไขข้อมูล เข้าไปแล้ว ข้อมูลที่อยู่ในช่องหายหมดเลยค่ะ เป็นแบบในรูปอ่ะค่ะ ในฐานข้อมูลก้อหายด้วย

00

EditPatient (PHP)
 <?
$id=$_GET['id_patient'];				  
$host = "localhost";
	$user = "root"; 
	$passwd = "1234"; 
	$dbname = "general";
	$tbname = "patient";
	
mysql_connect($host,$user,$passwd) or die("ติดต่อ Host ไม่ได้");
mysql_select_db($dbname) or die("ติดต่อฐานข้อมูลไม่ได้");

if ($id_patient>0){
mysql_query ("SET NAMES utf8") or die (mysql_errno());
$sql = "UPDATE `general`.`patient` 
SET `name_patient`='$name_patient',

`gender_patient`='$gender_patient',
`age_patient`='$age_patient',
`gblood`='$gblood',
`birthday_patient`='$birthday_patient',
`phone_patient`='$phone_patient',
`address_patient`='$address_patient',
`work_patient`='$work_patient',
`day_patient`='$day_patient',
`check_patient`='$check_patient',
`symptom`='$symptom',
`drug`='$drug',
`arrange`='$arrange',
`docter`='$docter'
WHERE `patient`.`id_patient` ='$id_patient' ;";
mysql_query($sql);
}
mysql_query ("SET NAMES utf8") or die (mysql_errno());
$sql = "SELECT * FROM `patient` where id_patient='$id'";
$result = mysql_query($sql);
echo"<table width='50%' border='1' bordercolor='#fff'  bgcolor='#34B2C9' ><tr align='center'>



</tr>";
$row=mysql_fetch_array($result);{
$id_patient= $row["id_patient"];
$name_patient= $row["name_patient"];
$gender_patient = $row["gender_patient"];
$age_patient = $row["age_patient"];
$gblood = $row["gblood"];
$birthday_patient = $row["birthday_patient"];
$phone_patient = $row["phone_patient"];

$address_patient = $row["address_patient"];
$work_patient = $row["work_patient"];
$day_patient = $row["day_patient"];
$check_patient = $row["check_patient"];
$symptom = $row["symptom"];
$drug = $row["drug"];
$arrange = $row["arrange"];
$docter = $row["docter"];



echo "<tr bgcolor='#C6EAF0' align='center'><form id='form1' name='form1' method='post' action='EditPatient.php'>";
echo "<input type='hidden' name='id_patient' value='$id_patient'></td>";
echo"<tr>";
echo"<td> ชื่อ-นามสกุลผู้ป่วย</td>";
echo "<td><input name='name_patient' type='text' value='$name_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>เพศ</td>";
echo "<td><input name='gender_patient' type='text' value='$gender_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>อายุ</td>";
echo "<td><input name='age_patient' type='text' value='$age_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>กรุ๊ปเลือด</td>";
echo "<td><input name='gblood' type='text' value='$gblood'></td>";
echo"<tr>";
echo"<td>วันเกิด</td>";
echo "<td><input name='birthday_patient' type='text' value='$birthday_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>เบอร์โทรศัพท์</td>";
echo "<td><input name='phone_patient' type='text' value='$phone_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>ที่อยู่</td>";
echo "<td><input name='address_patient' type='text' value='$address_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>อาชีพ</td>";
echo "<td><input name='work_patient' type='text' value='$work_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>วันที่รับการรักษา</td>";
echo "<td><input name='day_patient' type='text' value='$day_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>เช็คร่างกาย</td>";
echo "<td><input name='check_patient' type='text' value='$check_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>อาการที่เป็น</td>";
echo "<td><input name='symptom' type='text' value='$symptom'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>ยารักษา</td>";
echo "<td><input name='drug' type='text' value='$drug'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>วันนัด</td>";
echo "<td><input name='arrange' type='text' value='$arrange'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>แพทย์ที่รับผิดชอบ</td>";
echo "<td><input name='docter' type='text' value='$docter'></td>";
echo"</tr>";

echo "<td><input type='submit' name='Edit' id='Edit' value='Edit' onclick=" ?>
"return confirm('คุณแน่ใจว่าต้องการแก้ไขข้อมูลนี้หรือไม่ ? ')" /><? "/>";
echo "</td></form></tr>";
}
?>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-21 19:40:24 By : น้องกัปตัน
 


 

No. 4

Guest


ช่วยหน่อยนะค่ะ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-22 01:12:06 By : น้องกัปตัน
 


 

No. 5

Guest


ตอบหน่อยนะค่ะ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-22 11:50:53 By : น้องกัปตัน
 


 

No. 6

Guest


ช่วยหน่อยนะค่ะ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-22 18:42:33 By : น้องกัปตัน
 


 

No. 7



โพสกระทู้ ( 171 )
บทความ ( 0 )



สถานะออฟไลน์


อย่างที่คำตอบที่ 2 กับ 3 บอกน่ะครับ ในหน้าที่แสดงรายการชื่อผู้ป่วย คุณต้อง select ข้อมูลจาก database ถูกไหมครับ
แล้วในฐานข้อมูลมันจะต้องมีฟิลดิ์ที่เป็น ID ของผู้ป่วย เช่น ในฐานข้อมูลมีผู้ป่วย 5 คน ตัวอย่างจะเป็นแบบนี้

Table patient
ID Name
1 นาย ก
2 นาย ข
3 นาย ค
4 นาย ง
5 นาย จ

จากนั้น ตรงคำว่าแก้ไขข้อมูลผู้ป่วยที่จะทำ Link ไปยังหน้า edit ก็เอาข้อมูลที่เป็น ID ของผู้ป่วย ส่งค่าเข้าตัวแปร
แล้วเอาตังแปร ไป select ID ของผู้ป่วยมาแก้ไข
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-23 09:10:21 By : pantatonic
 


 

No. 8



โพสกระทู้ ( 3,748 )
บทความ ( 0 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์
Facebook

การแก้ไขอ้างตาม id ดังที่หลายๆท่านแนะนำนะครับ เช่นมีการวนลูปมันจะได้ id เรียงกันไปแล้วแต่ แต่จะสมมติให้นะครับ

while($row = mysql_fetch_array($data)){
/// แบบนี้มัน จะมี id เรียงกันไปเรื่อยๆแล้วแต่เราจะ select นะครับ

1,2,3,4,5 (สมมติ)

/// เราก็ทำการเรียกแสดงชื่อตามนั้น (แบบที่คุณทำไว้อยู่ก่อนแล้ว)

<a href="edit.php?id=<?=$row['id']?>">ชื่อคนไข้ที่จะแก้ไข จะวิ่งตามไอดีนั้นๆไปครับ </a> แบบนี้

ถ้าคนแรกก็จะได้ <a href="edit.php?id=1"></a> แบบนี้เป็นต้นครับ

และถ้าข้อมูลมี ถึง 5 หรือมากกว่านั้น มันก็จะเรียงลำดับกันลงไปเรื่อยๆครับ

}

สรุปก็คือ ถ้าอยากแก้ไขไอดีไหนก็ให้ข้อมูลวิ่งตามไอดีนั้นๆไปนะครับ เพียงแค่คำสั่ง ?id=

ส่วนในหน้ารับค่า (หน้า edit) ก็รับค่ามาแบบนี้ $id = $_GET['id'];
เวลาเรียกใช้ข้อมูลหน้า edit ก็
select * from คนไข้ where id = '$id'
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-23 09:53:54 By : Dragons_first
 


 

No. 9

Guest


คือว่า เปลี่ยน ตามหมดทุกอย่างแล้วค่ะ

แต่พอมันคลิกไป แล้วฟอร์ม edit มันไม่มีข้อมูลของคนให้ edit เหมือนรูป

ในความคิดเห็นที่No3


ในฐานข้อมูลก้อ ไม่มีด้วยค่ะ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-23 11:48:24 By : น้องกัปตัน
 


 

No. 10

Guest


ในตัว edit ต้องเรียกค่าเดิมมาด้วยนะครับ ถึงจะเห็นข้อมูลครับ..ลองคิดดูครับ..
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-23 15:22:23 By : หนึ่ง
 


 

No. 11



โพสกระทู้ ( 3,748 )
บทความ ( 0 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์
Facebook

ตามนี้ครับ
ส่วนในหน้ารับค่า (หน้า edit) ก็รับค่ามาแบบนี้ $id = $_GET['id'];
เวลาเรียกใช้ข้อมูลหน้า edit ก็
select * from คนไข้ where id = '$id'
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-23 15:46:24 By : Dragons_first
 


 

No. 12

Guest


ใส่แล้วค่ะ
บรรทัดที่ 2 กะ บรรทัด ที่34
แต่มันก้อไม่มีข้อมูลที่จะแก้ เหมือนเดิม เหมือนรูปในความคิดเห็น 03
EditPatient(PHP)
 <?
$id=$_GET['id_patient'];				  
$host = "localhost";
	$user = "root"; 
	$passwd = "1234"; 
	$dbname = "general";
	$tbname = "patient";
	
mysql_connect($host,$user,$passwd) or die("ติดต่อ Host ไม่ได้");
mysql_select_db($dbname) or die("ติดต่อฐานข้อมูลไม่ได้");

if ($id_patient>0){
mysql_query ("SET NAMES utf8") or die (mysql_errno());
$sql = "UPDATE `general`.`patient` 
SET `name_patient`='$name_patient',

`gender_patient`='$gender_patient',
`age_patient`='$age_patient',
`gblood`='$gblood',
`birthday_patient`='$birthday_patient',
`phone_patient`='$phone_patient',
`address_patient`='$address_patient',
`work_patient`='$work_patient',
`day_patient`='$day_patient',
`check_patient`='$check_patient',
`symptom`='$symptom',
`drug`='$drug',
`arrange`='$arrange',
`docter`='$docter'
WHERE `patient`.`id_patient` ='$id_patient' ;";
mysql_query($sql);
}
mysql_query ("SET NAMES utf8") or die (mysql_errno());
$sql = "SELECT * FROM `patient` where id_patient='$id'";
$result = mysql_query($sql);
echo"<table width='50%' border='1' bordercolor='#fff'  bgcolor='#34B2C9' ><tr align='center'>



</tr>";
$row=mysql_fetch_array($result);{
$id_patient= $row["id_patient"];
$name_patient= $row["name_patient"];
$gender_patient = $row["gender_patient"];
$age_patient = $row["age_patient"];
$gblood = $row["gblood"];
$birthday_patient = $row["birthday_patient"];
$phone_patient = $row["phone_patient"];

$address_patient = $row["address_patient"];
$work_patient = $row["work_patient"];
$day_patient = $row["day_patient"];
$check_patient = $row["check_patient"];
$symptom = $row["symptom"];
$drug = $row["drug"];
$arrange = $row["arrange"];
$docter = $row["docter"];



echo "<tr bgcolor='#C6EAF0' align='center'><form id='form1' name='form1' method='post' action='EditPatient.php'>";
echo "<input type='hidden' name='id_patient' value='$id_patient'></td>";
echo"<tr>";
echo"<td> ชื่อ-นามสกุลผู้ป่วย</td>";
echo "<td><input name='name_patient' type='text' value='$name_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>เพศ</td>";
echo "<td><input name='gender_patient' type='text' value='$gender_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>อายุ</td>";
echo "<td><input name='age_patient' type='text' value='$age_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>กรุ๊ปเลือด</td>";
echo "<td><input name='gblood' type='text' value='$gblood'></td>";
echo"<tr>";
echo"<td>วันเกิด</td>";
echo "<td><input name='birthday_patient' type='text' value='$birthday_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>เบอร์โทรศัพท์</td>";
echo "<td><input name='phone_patient' type='text' value='$phone_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>ที่อยู่</td>";
echo "<td><input name='address_patient' type='text' value='$address_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>อาชีพ</td>";
echo "<td><input name='work_patient' type='text' value='$work_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>วันที่รับการรักษา</td>";
echo "<td><input name='day_patient' type='text' value='$day_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>เช็คร่างกาย</td>";
echo "<td><input name='check_patient' type='text' value='$check_patient'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>อาการที่เป็น</td>";
echo "<td><input name='symptom' type='text' value='$symptom'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>ยารักษา</td>";
echo "<td><input name='drug' type='text' value='$drug'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>วันนัด</td>";
echo "<td><input name='arrange' type='text' value='$arrange'></td>";
echo"</tr>";
echo"<tr>";
echo"<td>แพทย์ที่รับผิดชอบ</td>";
echo "<td><input name='docter' type='text' value='$docter'></td>";
echo"</tr>";

echo "<td><input type='submit' name='Edit' id='Edit' value='Edit' onclick=" ?>
"return confirm('คุณแน่ใจว่าต้องการแก้ไขข้อมูลนี้หรือไม่ ? ')" /><? "/>";
echo "</td></form></tr>";
}
?>


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-23 15:54:29 By : น้องกัปตัน
 


 

No. 13

Guest


ใส่ตามที่บอกแล้วค่ะ แต่ยังไม่ได้อยู่ดี
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-24 01:21:26 By : น้องกัปตัน
 


 

No. 14



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook



Go to : PHP สร้างฟอร์มสำหรับ Upload รูปภาพลงในฐานข้อมูล MySQL พร้อมกับแบบ Form สำหรับการแก้ไขรูปภาพ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-24 06:25:30 By : webmaster
 


 

No. 15

Guest


อยากได้ฐานข้อมูลนี้จังเลยครับ พอดีทำโปรเจค โรงพยาบาลอยู๋เหมือนกัน ขอหน่อยได้ไหมครับ จะขอบคุณมากครับ [email protected]
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-29 18:28:08 By : เทอดศักดิ์
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ตอนนี้ทำ บันทึกประวัติของผู้ป่วย add ชื่อ มาโชว์ได้แล้ว แต่อยากได้คือ คลิกที่ชื่อไหน ก้อสามารถแก้ไขของคนนั้นได้แค่คนเดว
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 02
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่