Jump to content

Please help


Bee

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.