> Hi,
>
> Some of my foreign keys are chars, but the script does not
> quote them when building the 'where' clause.
>
> For example:
>
> select ... where country_iso_code=uy
>
> instead of
>
> select ... where country_iso_code='uy'

[....]

It seems quite strange, all the fields are quoted in select queries, look at the build_where_clause() function.

> Hi,
>
> Some of my foreign keys are chars, but the script does not
> quote them when building the 'where' clause.
>
> For example:
>
> select ... where country_iso_code=uy
>
> instead of
>
> select ... where country_iso_code='uy'
>
> I fixed that by adding a parameter to
> build_linked_field_values_ar with the content_field and
> checking if it's numeric or not inside the function.

[....]

You are right, the problem exists, thanks for having reported it.
Changing the line:
$sql .= " FROM ".$quote.$primary_key_table_field.$quote." WHERE ".$quote.$primary_key_field_field.$quote." = ".$field_value;
to:
$sql .= " FROM ".$quote.$primary_key_table_field.$quote." WHERE ".$quote.$primary_key_field_field.$quote." = '".$field_value."'";
in the function build_linked_field_values_ar() (file /include/business_logic.php) should be enough to fix it.