| |
Forum PHP IndonesiaDapatkan pertolongan pertama pada kebingungan PHP dan sekitarnya |
|
|
|
|
|
| |
|
|
All times are GMT + 7 Hours
|
|
Update Database gag jalan! Help
 |
Thu Aug 05, 2010 08:14 |
 |
Author |
Message |
CrackEnd PHP Programmer


Joined: 13 Jul 2010 Posts: 92
|
| Post subject: Update Database gag jalan! Help |
|
|
| Code: | <?php include "koneksi.php";
$no = @$_GET["no"];
$nama = @$_GET["nama"];
$pekerjaan = @$_GET["pekerjaan"];
$alamat = @$_GET["alamat"];
$tlp = @$_GET["tlp"];
$kemampuan = @$_GET["kemampuan"];
if(isset($no)){
if(empty($no)){
echo "kolom <b>no</b> tidak boleh kosong";
exit();
}
if(! $nama){
$query = mysql_query("update biodata set nama='$nama' where $no",$id_mysql);
}
if(! $pekerjaan){
$query = mysql_query("update biodata set pekerjaan='$pekerjaan' where $no",$id_mysql);
}
if(! $alamat){
$query = mysql_query("update biodata set alamat='$alamat' where $no",$id_mysql);
}
if(! $tlp){
$query = mysql_query("update biodata set tlp='$tlp' where $no",$id_mysql);
}
if(! $kemampuan){
$query = mysql_query("update biodata set kemampuan='$kemampuan' where $no",$id_mysql);
}
if (mysql_affected_rows()){
$msg = " <b>Data Berhasil diUbah</b>";
$ubah = "ubahdata.php";
header("Location: $ubah?msg=$msg");
}
else {
$msg = " <b>Data GAGAL diUbah</b>";
$ubah = "ubahdata.php";
header("Location: $ubah?msg=$msg");
}
} ?> |
tolong dong Gan!.
kenapa script yang saya tulis gag bisa ngerubah database yang saya buat yah!...
dari semua script yang saya tulis cuma disini deh yang gag bisa jalan!..
help me please!.
newbie nie!
[/quote] |
|
| |
|
|
 |
Thu Aug 05, 2010 08:23 |
 |
Author |
Message |
CrackEnd PHP Programmer


Joined: 13 Jul 2010 Posts: 92
|
| Post subject: solved |
|
|
| Code: | <?php include "koneksi.php";
$no = @$_GET["no"];
$nama = @$_GET["nama"];
$pekerjaan = @$_GET["pekerjaan"];
$alamat = @$_GET["alamat"];
$tlp = @$_GET["tlp"];
$kemampuan = @$_GET["kemampuan"];
if(isset($no)){
if(empty($no)){
echo "kolom <b>no</b> tidak boleh kosong";
exit();
}
if(! empty($nama)){
$query = mysql_query("update biodata set nama='$nama' where no='$no'",$id_mysql);
}
if(! empty($pekerjaan)){
$query = mysql_query("update biodata set pekerjaan='$pekerjaan' where no='$no'",$id_mysql);
}
if(! empty($alamat)){
$query = mysql_query("update biodata set alamat='$alamat' where no='$no'",$id_mysql);
}
if(! empty($tlp)){
$query = mysql_query("update biodata set tlp='$tlp' where no='$no'",$id_mysql);
}
if(! empty($kemampuan)){
$query = mysql_query("update biodata set kemampuan='$kemampuan' where no='$no'",$id_mysql);
}
if (mysql_affected_rows()){
$msg = " <b>Data Berhasil diUbah</b>";
$ubah = "ubahdata.php";
header("Location: $ubah?msg=$msg");
}
else {
$msg = " <b>Data GAGAL diUbah</b>";
$ubah = "ubahdata.php";
header("Location: $ubah?msg=$msg");
}
} ?> |
problem solved...
ternyata gag teliti GAN!
[/quote] |
|
| |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
|
|
|
Powered by phpBB © 2001, 2002 phpBB Group
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|