加单引号和大括号

$sql = "UPDATE test SET robotnum = '{$robotnum}' WHERE uid = '{$uid}';";