HN-Community
Buat From INPUT data PASIEN menggunakan PHP n Mysql - Printable Version

+- HN-Community (https://hacker-newbie.org)
+-- Forum: Miscellaneous (https://hacker-newbie.org/forum-86.html)
+--- Forum: Web/Graphic Design (https://hacker-newbie.org/forum-23.html)
+--- Thread: Buat From INPUT data PASIEN menggunakan PHP n Mysql (/thread-10729.html)



Buat From INPUT data PASIEN menggunakan PHP n Mysql - h4ck_world666 - 11-03-2011

Tolongin Ane gan, Ane Masih Newbie nih,,, masalah PHP...


Ane disuruh buat FROM kayak Gini nihhh ...

[Image: 311084_115563581888448_100003044196222_9...1810_n.jpg]

Disana disuruh bisa di edit, delete, simpan,, terus ada From cari juga

aduh.. please bantu ane...


RE: Buat From INPUT data PASIEN menggunakan PHP n Mysql - Dika_xb - 11-03-2011

pertanyaan salah ini bro

km bikin script, kalo ga ngerti baru tanya, jangan tanya keseluruhan

contoh : query untuk edit mysql gimana ya ??
lain kali gitu yah bro

km harus ngerti guna html untuk php
ini tutorial guna html untuk php
http://php.love-xb.us/cover%20awal.html

http://php.love-xb.us/

itu ada script basic php untuk mysql

good luck build your project


RE: Buat From INPUT data PASIEN menggunakan PHP n Mysql - Up_ - 11-03-2011

nah coba ajah dulu...ntar kita bantuin....!!




RE: Buat From INPUT data PASIEN menggunakan PHP n Mysql - h4ck_world666 - 11-03-2011

udah bro....

udah bisa nyimpan. tapi aneh klo udah di edit terus di simpan lagi ternyata gak nyimpan yang udah di editnya ,,,, ( hasil edit tidak keluar )...


nih scriptnya...

editpas.php
Quote:<html>
<body>
<h1>Tampil Data Customer</h1>
<hr>
<br>
<?
$conn=mysql_connect("localhost","root","");
mysql_select_db("rumahsakit");
$bb= $_GET[id];

$hasil=mysql_query("select * from pasien where id='$bb' limit 1");
$isi_record=mysql_fetch_row($hasil);

?>
<table>
<form action="updatepas.php" method="post">
<tr>
<td>No</td>
<td>:</td>
<td><input type="text" name="id" id="id" size="50" maxlength="50" value='<? echo("$isi_record[0]")?>'></td>
</tr>
<tr>
<td>Nama</td>
<td>:</td>
<td><input type="text" name="nama" id="nama" size="50" maxlength="50" value='<? echo("$isi_record[1]")?>'></td>
</tr>
<tr>
<td>Alamat</td>
<td>:</td>
<td><input type="text" name="alamat" id="alamat" size="50" maxlength="50" value='<? echo("$isi_record[2]")?>'></td>
</tr>
<tr>
<td>Golongan Darah</td>
<td>:</td>
<td><input type="radio" name="golongan_darah" value="A" checked="checked">A
<input type="radio" name="golongan_darah" value="B" >B
<input type="radio" name="golongan_darah" value="AB" >AB
<input type="radio" name="golongan_darah" value="O">O
</td>
</tr>
<tr>
<td>Jenis Kelamin</td>
<td>:</td>
<td>
<select name="jenis_kelamin" value='<? echo("$isi_record[4]")?>'>
<option>Laki-Laki</option>
<option>Perempuan</option>
</select>
</tr>
<tr>
<td>No Telpon</td>
<td>:</td>
<td><input type="text" name="telp" id="telp" size="50" maxlength="50" value='<? echo("$isi_record[5]")?>'></td>
</tr>
<tr>
<td>Pekerjaan</td>
<td>:</td>
<td><input type="text" name="pekerjaan" id="pekerjaan" size="50" maxlength="50" value='<? echo("$isi_record[6]")?>'></td>
</tr>
<tr>
<td></td>
<td></td>
<td><input type="submit" value="simpan"></td>
</tr>
</form>
</table>
</body>
</html>


updatepas.php
Quote:<?
$nama=$_REQUEST[nama];
$alamat=$_REQUEST[alamat];
$golongan_darah=$_REQUEST[golongan_darah];
$jenis_kelamin=$_REQUEST[jenis_kelamin];
$telp=$_REQUEST[telp];
$pekerjaan=$_REQUEST[pekerjaan];
$conn=mysql_connect("localhost","root","");
mysql_select_db("rumahsakit");
$bb=$_GET['id'];
$hasil=mysql_query("UPDATE pasien SET nama='$nama',alamat='$alamat',golongan_darah='$golongan_darah',jenis_kelamin='$jenis_kelamin',telp='$telp',pekerjaan='$pekerjaan' WHERE id='$bb' limit 1");
echo"<h2>Konfirmasi Perubahan Data</h2>";
echo"Data dengan id pasien <strong>$id</strong>sudah dirubah
<a href=lihatpas.php>Klik disini</a>untuk lihat daftar pasien";
?>

ane gak paham -,- HuwaaHuwaaHuwaa