MySQL Forums
Forum List  »  PHP

Re: How to UPDATE?
Posted by: Jay Pipes
Date: June 22, 2005 08:21PM

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 {


$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 {

if ($numrow>0)
echo "<script>alert('..::UPDATE RECORD::..');<//script>";
include 'list_projek.php';
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?

Options: ReplyQuote

Written By
June 20, 2005 09:15PM
June 21, 2005 02:50AM
June 22, 2005 07:09PM
Re: How to UPDATE?
June 22, 2005 08:21PM
June 22, 2005 08:41PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.