Problem while execute the Query

Discussion in 'PHP' started by sujithfem, Apr 22, 2008.

  1. #1
    Hi,
    I have a problem especially executing the query, I hope the problem due to special Character, i am using the ADOB for DB[MYSQL], Language is PHP, i have enclosed the function which make me hazard …….



    define('QRY_ALTER_CATEGORY', 'ALTER TABLE Category ADD %s');
    
     function ChangeCategory($FieldName) {
           $Condition = $FieldName.' VARCHAR(20)';
           $Query = sprintf(QRY_ALTER_CATEGORY,$Condition);
           $this->core->DBConn->Execute($Query);
        }
    PHP:

    The above Function used to Alter the Table Field name ,the problem is : if the Filed name is "Special character [íóÓéèÉÈÚúáàÁÀãñÑÖöÜüßÉ]” means the query is not execute other wise its works well ,please let me know the solution for the problem ,and expecting positive reply and advance thanks the same.
     
    sujithfem, Apr 22, 2008 IP
  2. sujithfem

    sujithfem Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    works fine after change the code like

    $Condition = '`' . $FieldName. '`' . ' VARCHAR(20)';
     
    sujithfem, Apr 22, 2008 IP
  3. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #3
    Why you are using special characters in field names? Is there any specific need?
     
    mwasif, Apr 22, 2008 IP