Dear all,

$sql    = "SELECT country FROM {ip2country}
             WHERE (%d >= `ip_range_first` AND %d <= `ip_range_last`) LIMIT 1";

This kind of quote does not exist in SQL 99 and will make any database fail, like PostgreSQL.

Instead, write:

$sql    = "SELECT country FROM {ip2country}
             WHERE (%d >= 'ip_range_first' AND %d <= 'ip_range_last') LIMIT 1";

Please apply.
Kind regards, Grub

Comments

mrfelton’s picture

Status: Reviewed & tested by the community » Active

Please don't mark as ready to be committed when a) there is no patch, and b) no one else has reviewed the code except yourself!