Bee Posted March 1, 2006 Share Posted March 1, 2006 Hi,I am having touble with this method. It's supposed to update records in a table.[code]function doModify($in){ //$in[0] = "Mr"; //$in[1] = "Jonny"; $sql = sprintf("UPDATE PersonalDetails SET Initials = '%s', Surname = '%s', Forename = '%s', Address = '%s', PostCode = '%s', TelHome = '%s', TelMobile = '%s', Email = '%s' WHERE UserID = '%s'", $this->escape($in['Initials']) , $this->escape($in['Surname']) , $this->escape($in['Forename']) , $this->escape($in['Address']), $this->escape($in['PostCode']), $this->escape($in['TelHome']), $this->escape($in['TelMobile']), $this->escape($in['Email']), $this->escape($in['UserID']) );//retrieves UserID from textbox // Trace the query in the NetConnection debugger NetDebug::trace($sql); // Run query on database $result = mysql_query($sql); // Check to see if the query did what it should have and return if (mysql_affected_rows() == 1) { return array("status" => "success"); } else { return array("status" => "fail"); } } [/code]Any suggestion will be very much appreciatedBee Quote Link to comment Share on other sites More sharing options...
fenway Posted March 1, 2006 Share Posted March 1, 2006 Nothing obviously wrong to me -- try adding a mysql_error() call after you query() attempt and see what the server says. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.