Jump to content


This topic is now archived and is closed to further replies.


Please help

Recommended Posts


I am having touble with this method. It's supposed to update records in a table.

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['UserID']) );//retrieves UserID from textbox
        // Trace the query in the NetConnection debugger
        // 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 appreciated


Share this post

Link to post
Share on other sites
Nothing obviously wrong to me -- try adding a mysql_error() call after you query() attempt and see what the server says.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.