Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/17/2020 in all areas

  1. I have a similar table (ip_lookup) with 5.2 million rows. CREATE TABLE `ip_lookup` ( `id` int(11) NOT NULL AUTO_INCREMENT, `start` varbinary(16) DEFAULT NULL, `end` varbinary(16) DEFAULT NULL, `continent` varchar(45) DEFAULT NULL, `country` varchar(45) DEFAULT NULL, `area` varchar(45) DEFAULT NULL, `city` varchar(145) DEFAULT NULL, PRIMARY KEY (`id`), KEY `idx_iplookup_ip` (`start`,`end`), KEY `idx_ip_lookup_end` (`end`) ) ENGINE=InnoDB AUTO_INCREMENT=5277083 DEFAULT CHARSET=utf8; FYI, here's a benchmark comparison of those two queries mysql> SELECT id, country, area, city -> FROM ip_lookup -> WHERE INET6_ATON('72.168.144.181') BETWEEN start AND end; +--------+---------------+------------+------------+ | id | country | area | city | +--------+---------------+------------+------------+ | 806584 | United States | California | Littlerock | +--------+---------------+------------+------------+ 1 row in set (3.49 sec) mysql> SELECT t.id, country, area, city FROM -> ( SELECT g.* -> FROM ip_lookup AS g -> WHERE g.start <= INET6_ATON('72.168.144.181') -> ORDER BY g.start DESC, g.end DESC -> LIMIT 1 -> ) AS t -> WHERE t.end >= INET6_ATON('72.168.144.181'); +--------+---------------+------------+------------+ | id | country | area | city | +--------+---------------+------------+------------+ | 806584 | United States | California | Littlerock | +--------+---------------+------------+------------+ 1 row in set (0.07 sec)
    1 point
  2. That is silly. Unless there is something important that you haven't described, there is absolutely no reason whatsoever to use Javascript to disable an element (no less to disable it using a mouseover event) when you could be using your PHP to output a textbox that is already disabled. You know that you can mark a textbox as disabled within its HTML. You know how to check a condition in PHP. I don't understand where the difficulty is in combining those two together to get a disabled textbox when some variable has some value.
    1 point
This leaderboard is set to New York/GMT-04:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.