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 Link to comment https://forums.phpfreaks.com/topic/3816-please-help/ 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. Link to comment https://forums.phpfreaks.com/topic/3816-please-help/#findComment-13380 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.