razaksamad
05-07-2008, 06:32 AM
Hi,I am trying to create an update script for my mysql database but cant get the thing to work
Heres the mysql update script (edit_masuk.php):
include("include_cari.php");
if(isset($_POST['Submit'])){
$id = $_REQUEST['id'];
$name = $_REQUEST['name'];
$sql = "UPDATE alumni SET name = '" . $name . "' WHERE id = '" . $id . "'";
$query = mysql_query($sql);
if ($query) {
header("location:display_cari.php");
exit;
}
}
$id = $_REQUEST['id'];
$result=mysql_query("select * from alumni where id='$id'");
$row=mysql_fetch_assoc($result);
Heres the mysql update script (edit_masuk.php):
include("include_cari.php");
if(isset($_POST['Submit'])){
$id = $_REQUEST['id'];
$name = $_REQUEST['name'];
$sql = "UPDATE alumni SET name = '" . $name . "' WHERE id = '" . $id . "'";
$query = mysql_query($sql);
if ($query) {
header("location:display_cari.php");
exit;
}
}
$id = $_REQUEST['id'];
$result=mysql_query("select * from alumni where id='$id'");
$row=mysql_fetch_assoc($result);