Use mysql_error() to find out what's up with your connection:
if (!$con=mysql_connect("localhost","root","")) {echo mysql_error();}
else {
if (!mysql_select_db($db,$con)) {echo mysql_error();}
else {
$id_projek=$_POST['id_projek'];
$homepage=$_POST['homepage'];
$project_name=$_POST['project_name'];
$desc=$_POST['desc'];
$day=$_POST['day'];
$month=$_POST['month'];
$year=$_POST['year'];
$status=$_POST['status'];
$email=$_POST['email'];
$q= "UPDATE $table SET id_projek='$id_projek', homepage='$homepage', project_name ='$project_name',desc ='$desc', day ='$day',month='$month', year ='$year', status ='$status', email ='$email' WHERE id_projek='$id_projek' ";
if (! $rslt=mysql_query($q)) {echo mysql_error();}
else {
$numrow=mysql_affected_rows();
if ($numrow>0)
{
echo "<script>alert('..::UPDATE RECORD::..');<//script>";
include 'list_projek.php';
}
else
{
echo "<script>alert('..::!FAILED TO UPDATE!::..');</script>";
include 'list_projek.php';
}
Sorry about the formatting of the code blocks...kind of tough to do properly on the MySQL forums...
}
}
Jay Pipes
Community Relations Manager, North America, MySQL Inc.
Got Cluster?
http://www.mysql.com/cluster
Personal:
http://jpipes.com