-
Posts
24,566 -
Joined
-
Last visited
-
Days Won
822
Everything posted by Barand
-
I want to disable a specific day on calendar HELP
Barand replied to ms115's topic in PHP Coding Help
You're probably right - I hadn't considered it might be a substitute for DATE(date_added) -
I want to disable a specific day on calendar HELP
Barand replied to ms115's topic in PHP Coding Help
@Gandalf64 for the above function to work, date_added needs to be in Y-m-d format, so why reformat it to Y-m-d format? -
Then you ain't doing it right. My background pattern... My code... <?php // texture $im1 = imagecreatefromjpeg('images/stripes.jpg'); list ($w, $h) = getimagesize('images/stripes.jpg'); // mask $im2 = imagecreatetruecolor($w, $h); $bg2 = imagecolorallocatealpha($im2, 255, 255, 255, 127); $txcolor = imagecolorallocate($im2, 0,0,0); imagefill($im2, 0, 0, $bg2); imagettftext($im2, 96, 0, 20, $h-20, $txcolor, 'c:/windows/fonts/arlrdbd.ttf', 'TEXT'); // target $im3 = imagecreatetruecolor($w, $h); $bg3 = imagecolorallocatealpha($im3, 80, 80, 255, 127); imagefill($im3, 0, 0, $bg3); imagesavealpha($im3, 1); // set pixels for ($y = 0; $y<$h; $y++) { for ($x = 0; $x<$w; $x++) { $c = imagecolorat($im2, $x, $y); if ($c == 0) imagesetpixel($im3, $x, $y, imagecolorat($im1, $x, $y) ); } } header("Content-Type: image/png"); imagepng($im3); imagedestroy($im1); imagedestroy($im2); imagedestroy($im3); ?> My output...
-
A more efficient way to write the code is not to check first if the username exists but to define a UNIQUE key on username column. The just add the record and trap any duplicate key exceptions. Like this... <?php if (!empty($_POST["username"]) && !empty($_POST["password"])) { $DBHOST = "localhost"; $DBUSER = "tim"; $DBPWD = "nineteen1985"; $DBNAME = "customs_auction"; mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); $conn = new mysqli($DBHOST, $DBUSER, $DBPWD, $DBNAME); $hashed = password_hash($_POST["password"], PASSWORD_DEFAULT); try { $statement = "INSERT INTO buyer(username,password) VALUES(?, ?)"; $stmt = $conn->prepare($statement); $stmt->bind_param("ss", $_POST["username"], $hashed); $stmt->execute(); header("Location: add_buyer.php?buyer=successful"); } catch (mysqli_sql_exception $e) { if ($e->getCode() == 1062) { header("Location: add_buyer.php?buyer=duplicate"); } else throw $e; } } else { header("Location: add_buyer.php"); } ?>
-
There is no data because no code executes to add them. You have a $POST instead of $_POST so the first if() fails. You use "execute" instead of "execute()" You need to remove the html code from the start of check_buyer.php otherwise the header() calls will fail (you can't sent output before a header() call.) There is no need for any html in that file.
-
So what are the symptoms that lead you to say it isn't updating?
-
Check for db errors. Put this line mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); before you create the mysqli connection
-
Hints Put the numbers 0 - 99 in an array and use array_chunk() to get the rows. Loop through each chunk to get the cells in each row. when checking for N is prime, it is necessary only to check for factors <= sqrt(N)
-
a retrieval out of 4 x 700 records of national data-sets
Barand replied to dil_bert's topic in Miscellaneous
One big table with column indicating the type of data (1=hospital, 2=bakery, 3=pharmacy, 4=grocery etc) plus a second table to store those types and type numbers. -
Use array_chunk() to break up the array into many arrays of 100 in each EG $data = range(1, 250); $chunks = array_chunk($data, 25); foreach ($chunks as $chunk) { foreach ($chunk as $n) { printf('%03d ', $n); } echo '<br>'; } Giving 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 064 065 066 067 068 069 070 071 072 073 074 075 076 077 078 079 080 081 082 083 084 085 086 087 088 089 090 091 092 093 094 095 096 097 098 099 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 The 318000 items aren't coming from another table, are they?
-
I agree with that approach. However, there may be cases where you have a JS function that is called as a result of user interaction and which also provides an initial value when the page loads. In that case it would make sense to call it on page load rather than duplicate the function in PHP. Horses for courses.
-
Personally, I wouldn't expect the user to enter the corrrect format. And even if the format is correct there is no guarantee that the value is valid E.G. (2020/19) or (2020/22) I would ask the user to enter the "2020" part and then generate the required format $input = 2000; $ay = sprintf("(%4d/%02d)", $input, ($input+1)%100); echo $ay; //--> (2000/01) My 0.02 worth. @kicken, I definitely come bottom of the class when it comes to regex and avoid it like the plague. However, as I was asked about this problem, I gave it go and eventually came up with a pattern of '#\(\d{4}\/\d{2}\)#' which appeared to do the job. My delimiters are different from yours, so is it wrong?
-
With hierarchical data like this, I find it useful to store the records in an array indexed by parent. For example $res = $db->query("SELECT id , message_id as parent , subject FROM message ORDER BY message_id, id DESC "); $msgs = []; foreach ($res as $r) { $msgs[$r['parent']][] = [ 'id'=>$r['id'], 'subject'=>$r['subject'] ]; // store in array by parent } $results = []; foreach ($msgs[0] as $m) { // loop through parent 0 if (!isset($msgs[$m['id']])) { $latest = $m; // no child messages } else { $latest = $msgs[$m['id']][0]; // last child message } $results[$latest['id']] = $latest['subject']; } krsort($results); // sort ids descending echo '<pre>', print_r($results, 1), '</pre>'; // show results Results: Array ( [7] => Message 4 [6] => Message 3 Reply 1 [4] => Message 1 Reply 2 [3] => Message 2 )
-
I have been experimenting with three different configurations of your data. Version 1 - as you have have it now. Version 2 - remove the keywords column and put keywords in separate table, one keyword per row (normalized) with index on keyword column. Version 3 - as version 2 but with keyword in one column and soundex(keyword) in a separate column (indexes on both columns) I still only have the 133 rows so I performed searches for 400 keywords 5 times on each configuration. Each set of 2000 searches (on a sluggish SQL database?) took less than a second. Version 3 was consistently fastest. Times for 2,000 keyword searches Version 1 : 0.949888 seconds Version 2 : 0.872437 seconds Version 3 : 0.615272 seconds Version 3: +------------------+ | taxonomy | +------------------+ | id |---------+ +--------------+ | title | | | keyword | | common | | +--------------+ | link | | | kw_id | | id | +--------<| tax_id | +------------------+ | kword | | skword | +--------------+ SELECT id, title, common FROM taxonomy_1 t JOIN keyword_2 k ON t.id = k.tax_id WHERE kword = 'strna' OR skword = 'S365'; +----+---------------------+---------------+ | id | title | common | +----+---------------------+---------------+ | 15 | Sturnus vulgaris | Starling | | 65 | Sterna hirundo | Common Tern | | 66 | Sterna sandvicensis | Sandwich Tern | | 67 | Sternula albifrons | Little Tern | | 68 | Sterna paradisaea | Arctic Tern | +----+---------------------+---------------+
-
Beware of difference between MySQL soundex() and PHP soundex() results when creating and querying the data echo soundex('sterna'); // ==> S365 echo soundex('sternus'); // ==> S365 echo soundex('sternula'); // ==> S365 mysql> select SOUNDEX('sterna'), SOUNDEX('sternus'), SOUNDEX('sternula'); +-------------------+--------------------+---------------------+ | SOUNDEX('sterna') | SOUNDEX('sternus') | SOUNDEX('sternula') | +-------------------+--------------------+---------------------+ | S365 | S3652 | S3654 | +-------------------+--------------------+---------------------+
-
I decided to create a test table of my own. Only 133 records so far. I want several hundred before I try benchmark time tests on it so I'll generate a few hundred more dummy ones. CREATE TABLE `taxonomy_base` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(128) DEFAULT NULL, `common` varchar(45) DEFAULT NULL, `link` varchar(128) DEFAULT NULL, `keywords` text, `percent` decimal(6,2) DEFAULT NULL, -- added a couple of columns on population `trend` varchar(45) DEFAULT NULL, -- increase/decline for a charting exercise PRIMARY KEY (`id`), FULLTEXT KEY `keywords` (`keywords`) ) ENGINE=InnoDB AUTO_INCREMENT=134 DEFAULT CHARSET=utf8; INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (1,'Cyanistes caeruleus','Blue tit','path/to/sp','Cyanistes caeruleus blau meise meisen blaumeise blaumeisen blue tit tits bluetits bluechickadees chickadee chickadees C5232 C642 B400 M200 M250 B452 B4525 B400 T000 T200 B432 B4232 C300 C320',NULL,NULL); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (2,'Chloris chloris','Greenfinch',NULL,'chloris greenfinch C462 G651',-9.47,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (3,'Corvus monedula','Jackdaw',NULL,'corvus monedula jackdaw C612 M534 J230',2.79,'weak increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (4,'Falco tinnunculus','Kestrel',NULL,'falco tinnunculus kestrel F420 T552 K236',-3.99,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (5,'Emberiza schoeniclus','Reed Bunting',NULL,'emberiza schoeniclus reed bunting E516 S524 R300 B535',0.80,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (6,'Corvus frugilegus','Rook',NULL,'corvus frugilegus rook C612 F624 R200',-1.52,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (7,'Columba palumbus','Woodpigeon',NULL,'columba palumbus woodpigeon C451 P451 W312',-0.42,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (8,'Motacilla flava','Yellow Wagtail',NULL,'motacilla flava yellow wagtail M324 F410 Y400 W234',4.32,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (9,'Emberiza calandra','Corn Bunting',NULL,'emberiza calandra corn bunting E516 C453 C650 B535',-0.04,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (10,'Carduelis carduelis','Goldfinch',NULL,'carduelis goldfinch C634 G431',4.08,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (11,'Perdix perdix','Grey Partridge',NULL,'perdix grey partridge P632 G600 P636',-3.24,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (12,'Vanellus vanellus','Lapwing',NULL,'vanellus lapwing V542 L152',-6.12,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (13,'Carduelis cannabina','Linnet',NULL,'carduelis cannabina linnet C634 C515 L530',-0.21,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (14,'Alauda arvensis','Skylark',NULL,'alauda arvensis skylark A430 A615 S462',-2.18,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (15,'Sturnus vulgaris','Starling',NULL,'sturnus vulgaris starling S365 V426 S364',-1.72,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (16,'Columba oenas','Stock Dove',NULL,'columba oenas stock dove C451 O520 S320 D100',4.06,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (17,'Passer montanus','Tree Sparrow',NULL,'passer montanus tree sparrow P260 M535 T600 S160',4.14,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (18,'Streptopelia turtur','Turtle Dove',NULL,'streptopelia turtur turtle dove S361 T636 T634 D100',-21.41,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (19,'Sylvia communis','Whitethroat',NULL,'sylvia communis whitethroat S410 C552 W336',1.23,'weak increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (20,'Turdus merula','Blackbird',NULL,'turdus merula blackbird T632 M640 B421',-0.36,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (21,'Cyanistes caeruleus','Blue Tit',NULL,'cyanistes caeruleus blue tit C523 C642 B400 T300',-0.43,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (22,'Pyrrhula pyrrhula','Bullfinch',NULL,'pyrrhula bullfinch P640 B415',2.38,'weak increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (23,'Fringilla coelebs','Chaffinch',NULL,'fringilla coelebs chaffinch F652 C412 C152',-1.49,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (24,'Prunella modularis','Dunnock',NULL,'prunella modularis dunnock P654 M346 D520',0.01,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (25,'Parus major','Great Tit',NULL,'parus major great tit P620 M260 G630 T300',-0.80,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (26,'Sylvia curruca','Lesser Whitethroat',NULL,'sylvia curruca lesser whitethroat S410 C620 L260 W336',0.01,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (27,'Aegithalos caudatus','Long-tailed Tit',NULL,'aegithalos caudatus long-tailed tit A234 C332 L523 T300',-2.13,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (28,'Erithacus rubecula','Robin',NULL,'erithacus rubecula robin E632 R124 R150',-0.06,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (29,'Turdus philomelos','Song Thrush',NULL,'turdus philomelos song thrush T632 P454 S520 T620',-0.88,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (30,'Strix aluco','Tawny Owl',NULL,'strix aluco tawny owl S362 A420 T500 O400',0.64,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (31,'Troglodytes troglodytes','Wren',NULL,'troglodytes wren T624 W650',1.84,'weak increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (32,'Sylvia atricapilla','Blackcap',NULL,'sylvia atricapilla blackcap S410 A362 B421',6.93,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (33,'Phylloscopus collybita','Chiffchaff',NULL,'phylloscopus collybita chiffchaff P421 C413 C121',4.13,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (34,'Periparus ater','Coal Tit',NULL,'periparus ater coal tit P616 A360 C400 T300',-2.14,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (35,'Sylvia borin','Garden Warbler',NULL,'sylvia borin garden warbler S410 B650 G635 W614',-1.94,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (36,'Regulus regulus','Goldcrest',NULL,'regulus goldcrest R242 G432',0.09,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (37,'Dendrocopos major','Great Spotted Woodpecker',NULL,'dendrocopos major great spotted woodpecker D536 M260 G630 S133 W312',-0.27,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (38,'Picus viridis','Green Woodpecker',NULL,'picus viridis green woodpecker P220 V632 G650 W312',-1.70,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (39,'Garrulus glandarius','Jay',NULL,'garrulus glandarius jay G642 G453 J000',1.78,'weak increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (40,'Dendrocopos minor','Lesser Spotted Woodpecker',NULL,'dendrocopos minor lesser spotted woodpecker D536 M560 L260 S133 W312',-11.08,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (41,'Poecile palustris','Marsh Tit',NULL,'poecile palustris marsh tit P240 P423 M620 T300',-2.50,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (42,'Luscinia megarhynchos','Nightingale',NULL,'luscinia megarhynchos nightingale L250 M265 N235',5.04,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (43,'Sitta europaea','Nuthatch',NULL,'sitta europaea nuthatch S300 E610 N332',2.91,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (44,'Carduelis cabaret','Lesser Redpoll',NULL,'carduelis cabaret lesser redpoll C634 C163 L260 R314',2.58,'weak increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (45,'Phoenicurus phoenicurus','Redstart',NULL,'phoenicurus redstart P526 R323',6.20,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (46,'Accipiter nisus','Sparrowhawk',NULL,'accipiter nisus sparrowhawk A213 N220 S162',-1.11,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (47,'Muscicapa striata','Spotted Flycatcher',NULL,'muscicapa striata spotted flycatcher M221 S363 S133 F423',1.15,'weak increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (48,'Anthus trivialis','Tree Pipit',NULL,'anthus trivialis tree pipit A532 T614 T600 P130',4.98,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (49,'Certhia familiaris','Treecreeper',NULL,'certhia familiaris treecreeper C630 F546 T626',2.03,'weak increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (50,'Poecile montana','Willow Tit',NULL,'poecile montana willow tit P240 M535 W400 T300',-1.46,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (51,'Phylloscopus trochilus','Willow Warbler',NULL,'phylloscopus trochilus willow warbler P421 T624 W400 W614',-1.41,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (52,'Ficedula hypoleuca','Pied Flycatcher',NULL,'ficedula hypoleuca pied flycatcher F234 H142 P300 F423',2.77,'weak increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (53,'Phylloscopus sibilatrix','Wood Warbler',NULL,'phylloscopus sibilatrix wood warbler P421 S143 W300 W614',2.43,'weak increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (54,'Loxia curvirostra','Common Crossbill',NULL,'loxia curvirostra common crossbill L200 C616 C550 C621',-4.94,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (55,'Carduelis spinus','Siskin',NULL,'carduelis spinus siskin C634 S152 S250',-0.49,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (56,'Tetrao urogallus','Capercaillie',NULL,'tetrao urogallus capercaillie T360 U624 C162',-2.38,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (57,'Stercorarius parasiticus','Arctic Skua',NULL,'stercorarius parasiticus arctic skua S362 P623 A623 S000',-15.16,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (58,'Rissa tridactyla','Black-legged kittiwake',NULL,'rissa tridactyla black-legged kittiwake R200 T632 B424 K320',-2.66,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (59,'Uria aalge','Common guillemot',NULL,'uria aalge common guillemot U600 A420 C550 G453',3.15,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (60,'Phalacrocorax artistotelis','European shag',NULL,'phalacrocorax artistotelis european shag P426 A632 E615 S200',-4.39,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (61,'Larus marinus','Great Black-backed Gull',NULL,'larus marinus great black-backed gull L620 M652 G630 B421 G400',5.07,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (62,'Phalacrocorax carbo','Great cormorant',NULL,'phalacrocorax carbo great cormorant P426 C610 G630 C656',-1.78,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (63,'Larus argentatus','Herring Gull',NULL,'larus argentatus herring gull L620 A625 H652 G400',7.96,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (64,'Fulmarus glacialis','Northern fulmar',NULL,'fulmarus glacialis northern fulmar F456 G424 N636 F456',-2.54,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (65,'Sterna hirundo','Common Tern',NULL,'sterna hirundo common tern S365 H653 C550 T650',-5.28,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (66,'Sterna sandvicensis','Sandwich Tern',NULL,'sterna sandvicensis sandwich tern S365 S531 S532 T650',-3.96,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (67,'Sternula albifrons','Little Tern',NULL,'sternula albifrons little tern S365 A411 L340 T650',0.75,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (68,'Sterna paradisaea','Arctic Tern',NULL,'sterna paradisaea arctic tern S365 P632 A623 T650',2.88,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (69,'Alca torda','Razorbill',NULL,'alca torda razorbill A420 T630 R261',2.82,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (70,'Actitis hypoleucos','Common Sandpiper',NULL,'actitis hypoleucos common sandpiper A233 H142 C550 S531',-2.04,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (71,'Cinclus cinclus','Dipper',NULL,'cinclus dipper C524 D160',-0.08,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (72,'Mergus merganser','Goosander',NULL,'mergus merganser goosander M622 M625 G253',3.10,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (73,'Motacilla cinerea','Grey Wagtail',NULL,'motacilla cinerea grey wagtail M324 C560 G600 W234',-3.04,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (74,'Cettia cetti','Cetti\'s Warbler',NULL,'cettia cetti cetti\'s warbler C300 C300 C320 W614',1.91,'weak increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (75,'Emberiza schoeniclus','Reed Bunting',NULL,'emberiza schoeniclus reed bunting E516 S524 R300 B535',-2.40,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (76,'Acrocephalus scirpaceus','Reed Warbler',NULL,'acrocephalus scirpaceus reed warbler A262 S612 R300 W614',-1.52,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (77,'Acrocephalus schoenobaenus','Sedge Warbler',NULL,'acrocephalus schoenobaenus sedge warbler A262 S515 S320 W614',-4.52,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (78,'Fulica atra','Coot',NULL,'fulica atra coot F420 A360 C300',-3.87,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (79,'Podiceps cristatus','Great Crested Grebe',NULL,'podiceps cristatus great crested grebe P321 C623 G630 C623 G610',-2.82,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (80,'Tachybaptus ruficollis','Little Grebe',NULL,'tachybaptus ruficollis little grebe T211 R124 L340 G610',0.11,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (81,'Anas platyrhynchos','Mallard',NULL,'anas platyrhynchos mallard A520 P436 M463',-0.98,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (82,'Gallinula chloropus','Moorhen',NULL,'gallinula chloropus moorhen G454 C461 M650',-3.81,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (83,'Aythya fuligula','Tufted Duck',NULL,'aythya fuligula tufted duck A300 F424 T133 D200',-1.21,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (84,'Numenius arquata','Curlew',NULL,'numenius arquata curlew N552 A623 C640',-0.78,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (85,'Vanellus vanellus','Lapwing',NULL,'vanellus lapwing V542 L152',-3.42,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (86,'Egretta garzetta','Little Egret',NULL,'egretta garzetta little egret E263 G623 L340 E263',4.76,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (87,'Cygnus olor','Mute Swan',NULL,'cygnus olor mute swan C252 O460 M300 S500',-0.27,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (88,'Tringa totanus','Redshank',NULL,'tringa totanus redshank T652 T352 R325',0.12,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (89,'Gallinago gallinago','Snipe',NULL,'gallinago snipe G452 S510',-0.64,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (90,'Anas crecca','Teal',NULL,'anas crecca teal A520 C620 T400',5.85,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (91,'Motacilla flava','Yellow Wagtail',NULL,'motacilla flava yellow wagtail M324 F410 Y400 W234',-12.79,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (92,'Ardea cinerea','Grey Heron',NULL,'ardea cinerea grey heron A630 C560 G600 H650',-1.47,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (93,'Alcedo atthis','Kingfisher',NULL,'alcedo atthis kingfisher A423 A320 K521',-2.12,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (94,'Haematopus ostralegus','Oystercatcher',NULL,'haematopus ostralegus oystercatcher H531 O236 O236',0.00,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (95,'Riparia riparia','Sand Martin',NULL,'riparia sand martin R160 S530 M635',0.00,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (96,'Recurvirostra avosetta','Avocet',NULL,'recurvirostra avosetta avocet R261 A123 A123',0.93,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (97,'Panurus biarmicus','Bearded Tit',NULL,'panurus biarmicus bearded tit P562 B652 B633 T300',5.22,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (98,'Chroicocephalus ridibundus','Black-headed Gull',NULL,'chroicocephalus ridibundus black-headed gull C622 R315 B423 G400',0.85,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (99,'Buteo buteo','Buzzard',NULL,'buteo buzzard B300 B263',0.69,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (100,'Corvus corone','Carrion Crow',NULL,'corvus corone carrion crow C612 C650 C650 C600',0.79,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (101,'Emberiza cirlus','Cirl Bunting',NULL,'emberiza cirlus cirl bunting E516 C642 C640 B535',3.81,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (102,'Streptopelia decaocto','Collared Dove',NULL,'streptopelia decaocto collared dove S361 D223 C463 D100',-2.81,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (103,'Crex crex','Corncrake',NULL,'crex corncrake C620 C652',-0.82,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (104,'Cuculus canorus','Cuckoo',NULL,'cuculus canorus cuckoo C242 C562 C200',2.53,'weak increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (105,'Sylvia undata','Dartford Warbler',NULL,'sylvia undata dartford warbler S410 U533 D631 W614',-10.24,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (106,'Regulus ignicapilla','Firecrest',NULL,'regulus ignicapilla firecrest R242 I252 F626',21.77,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (107,'Anas strepera','Gadwall',NULL,'anas strepera gadwall A520 S361 G340',3.66,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (108,'Pluvialis apricaria','Golden Plover',NULL,'pluvialis apricaria golden plover P414 A162 G435 P416',-0.69,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (109,'Anser anser','Greylag Goose',NULL,'anser greylag goose A526 G642 G200',3.05,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (110,'Circus cyaneus','Hen Harrier',NULL,'circus cyaneus hen harrier C622 C520 H500 H660',-3.23,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (111,'Falco subbuteo','Hobby',NULL,'falco subbuteo hobby F420 S130 H100',-4.82,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (112,'Corvus cornix','Hooded Crow',NULL,'corvus cornix hooded crow C612 C652 H330 C600',3.17,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (113,'Delichon urbicum','House Martin',NULL,'delichon urbicum house martin D425 U612 H200 M635',-1.62,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (114,'Passer domesticus','House Sparrow',NULL,'passer domesticus house sparrow P260 D523 H200 S160',0.37,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (115,'Pica pica','Magpie',NULL,'pica magpie P200 M210',0.51,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (116,'Anthus pratensis','Meadow Pipit',NULL,'anthus pratensis meadow pipit A532 P635 M300 P130',2.92,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (117,'Larus melanocephalus','Mediterranean Gull',NULL,'larus melanocephalus mediterranean gull L620 M452 M336 G400',3.72,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (118,'Turdus viscivorus','Mistle Thrush',NULL,'turdus viscivorus mistle thrush T632 V216 M234 T620',-1.79,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (119,'Falco peregrinus','Peregrine',NULL,'falco peregrinus peregrine F420 P626 P626',0.44,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (120,'Motacilla alba','Pied/White Wagtail',NULL,'motacilla alba pied/white wagtail M324 A410 P330 W234',1.06,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (121,'Aythya ferina','Pochard',NULL,'aythya ferina pochard A300 F650 P263',3.87,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (122,'Coturnix coturnix','Quail',NULL,'coturnix quail C365 Q400',-9.40,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (123,'Corvus corax','Raven',NULL,'corvus corax raven C612 C620 R150',1.61,'weak increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (124,'Lagopus lagopus scotica','Red Grouse',NULL,'lagopus scotica red grouse L212 S320 R300 G620',5.44,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (125,'Milvus milvus','Red Kite',NULL,'milvus red kite M412 R300 K300',13.15,'strong increase'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (126,'Mergus serrator','Red-breasted Merganser',NULL,'mergus serrator red-breasted merganser M622 S636 R316 M625',-2.63,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (127,'Tadorna tadorna','Shelduck',NULL,'tadorna shelduck T365 S432',-1.46,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (128,'Anas clypeata','Shoveler',NULL,'anas clypeata shoveler A520 C413 S146',1.01,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (129,'Saxicola rubicola','Stonechat',NULL,'saxicola rubicola stonechat S224 R124 S352',-8.24,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (130,'Hirundo rustica','Swallow',NULL,'hirundo rustica swallow H653 R232 S400',-1.38,'weak decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (131,'Apus apus','Swift',NULL,'apus swift A120 S130',-4.83,'strong decline'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (132,'Saxicola rubetra','Whinchat',NULL,'saxicola rubetra whinchat S224 R136 W523',-0.34,'no change'); INSERT INTO `taxonomy_base` (`id`,`title`,`common`,`link`,`keywords`,`percent`,`trend`) VALUES (133,'Lullula arborea','Woodlark',NULL,'lullula arborea woodlark L440 A616 W346',4.67,'strong increase');
-
Sounds like you are manully typing in the data when you already have it in your files. (Or are keywords a new addition?)
-
The latter statement may well explain the former. Queries on a single record table tend to be at the faster end of the spectrum. I was expecting you to have thousands of species.
-
I may be guilty of exaggeration. I was just saying that the queries are are going be as slow as they could get. If you want to send me a dump of your full taxonomy table I'll experiment to see if I can find a way to make searches more efficient