Jump to content

Archived

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

Bee

Please help

Recommended Posts

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 appreciated

Bee

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.