VARCHAR not accepting strings with non-numerical characters

I am trying to store a Facebook access token in my MySQL database. I have set the field to take a VARCHAR of length 255 and it can accept strings of numerical characters, but if the string includes any non-numerical character then it fails. Does anyone know why this could be happening? I can't seem to find any other cases of this happening anywhere. The only things I could think of are that is may have something to do with this setting "latin1_swedish_ci".

The function I am using to input my data is below:

// Insert the extended access token into the database
function setUserAccessToken($_uid, $_accTok){
        $sql = "UPDATE `user_core` SET `acc_tok`=$_accTok WHERE `id` = $_uid";

        $_result = mysql_query($sql);
        if($_result){
            echo ("Successful!");   
        }
        else
        {
            echo ("Failed!");
        }
} 

Thanks in advance :D

Answers


You're missing quotes:

$sql = "UPDATE `user_core` SET `acc_tok`='$_accTok' WHERE `id` = $_uid";

Need Your Help