I need to trim the " from this value.

Would this work?

The field is Name_Last and looks like this.

"ABRAHAM

$stripname = $db->sql_query("UPDATE ".$prefix."$table_name SET Name_Last = ltrim(Name_Last, '\"')");

    If I'm understanding you want to remove the double quote from the left side of the entry in Name_Last column, is this correct?

    If so them you can try this.

    $stripname = $db->sql_query("UPDATE ".$prefix."$table_name SET Name_Last = TRIM(LEADING '\"' From Name_Last");
    

    Btw I don't think you can use a PHP function in a SQL query, I could be wrong though.

      joe_C_nice's query should work.

      LTRIM() is actually a MySQL function, though it doesn't behave quite like PHP's function; for an explanation, look in the MySQL manual.

        Correct LTRIM is a MySQL function but to my understanding it only removes leading spaces and the way in which he was employing it would indicate he's getting it confused with the PHP function ltrim.

        Btw if this problem has been solved in the thread starter could mark it as RESOLVED.

          Write a Reply...