Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > it.comp.www.php > #22561

Re: operatore jolly mysql

From logica mente <npaolini_no_spam_@ennepisoft.it>
Newsgroups it.comp.www.php
Subject Re: operatore jolly mysql
Date 2019-02-14 16:57 +0100
Organization Aioe.org NNTP Server
Message-ID <q4434c$1p88$1@gioia.aioe.org> (permalink)
References (4 earlier) <gckv04F8uu0U1@mid.individual.net> <20190214114846.248af45e@nntp.aioe.org> <gckvn6F934qU1@mid.individual.net> <20190214120055.4b5f1b19@nntp.aioe.org> <20190214162342.51129c53@nntp.aioe.org>

Show all headers | View raw


Il 14/02/2019 16:23, Enrico Maria Chellini ha scritto:
> Il giorno Thu, 14 Feb 2019 12:00:55 +0100
> Enrico Maria Chellini <bitit@bitit.it> ha scritto:
> 
>>> Dipende dall'engine, ma quando usi LIKE attivi il partial match
>>> sulla stringa, che potrebbe bypassare gli indici e quindi
>>> massacrarti le prestazioni.
>>>
>>> Se hai 100 elementi nel DB chissene. Se ne hai milioni aspetti per
>>> qualche mezz'ora ad ogni query.
>>>
>>> Bye.
>>
>> Quello che sospettavo .
>> ci saranno un migliaio di record al massimo; ma cercherò di scrivere
>> qualcosa di esteticamente migliore e più funzionale
>>
>> Grazie ancora
>> Enrico
>>
> 
> In pratica, per fare un esempio, se ho  le relative opzioni
> |provincia|località|categoria|camere|cucina|bagno|ariacondizionata|piscina|forno|tv|etc.
> 
> dovrò scrivere una query per ogni combinazione richiesta o sbaglio?
> 
> cosa mi son perso?
> 
> 

puoi scrivere qualcosa di simile ...
----------
$all = array(
	array('provincia', 'prov'),
	array('camere', 'camere'),
	);
$conc = '';
$q = ' WHERE ';
foreach($all as $item) {
	if(isset($_GET[$item[1]])) {
		$q .= $conc . $item[0]. '=' . $_GET[$item[1]];
		$conc = ' AND ';
		}
	}
if('' == $conc) {
	// nessun valore
	}
--------

Back to it.comp.www.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-13 12:28 +0100
  Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-13 16:11 +0100
    Re: operatore jolly mysql fmigliori <fmigliori@gmail.com> - 2019-02-13 12:30 -0800
      Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-14 11:30 +0100
        Re: operatore jolly mysql Alessandro Pellizzari <shuriken@amiran.it> - 2019-02-14 10:42 +0000
          Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-14 11:48 +0100
            Re: operatore jolly mysql Alessandro Pellizzari <shuriken@amiran.it> - 2019-02-14 10:54 +0000
              Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-14 12:00 +0100
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-14 16:23 +0100
                Re: operatore jolly mysql logica mente <npaolini_no_spam_@ennepisoft.it> - 2019-02-14 16:57 +0100
                Re: operatore jolly mysql Alessandro Pellizzari <shuriken@amiran.it> - 2019-02-14 16:11 +0000
                Re: operatore jolly mysql logica mente <npaolini_no_spam_@ennepisoft.it> - 2019-02-14 18:41 +0100
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-14 17:21 +0100
                Re: operatore jolly mysql Alessandro Pellizzari <shuriken@amiran.it> - 2019-02-14 16:48 +0000
                Re: operatore jolly mysql Alessandro Pellizzari <shuriken@amiran.it> - 2019-02-14 16:05 +0000
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-14 17:41 +0100
                Re: operatore jolly mysql Alessandro Pellizzari <shuriken@amiran.it> - 2019-02-14 17:08 +0000
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-14 18:25 +0100
                Re: operatore jolly mysql Alessandro Pellizzari <shuriken@amiran.it> - 2019-02-14 21:28 +0000
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-15 11:01 +0100
                Re: operatore jolly mysql Alessandro Pellizzari <shuriken@amiran.it> - 2019-02-15 16:56 +0000
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-15 18:47 +0100
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-15 19:41 +0100
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-16 13:01 +0100
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-16 15:35 +0100
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-16 16:18 +0100
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-15 12:47 +0100
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-15 14:07 +0100
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-15 15:08 +0100
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-15 15:41 +0100
                Re: operatore jolly mysql fmigliori <fmigliori@gmail.com> - 2019-02-15 07:44 -0800
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-15 17:28 +0100
                Re: operatore jolly mysql fmigliori <fmigliori@gmail.com> - 2019-02-15 10:27 -0800
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-15 20:15 +0100
                Re: operatore jolly mysql fmigliori <fmigliori@gmail.com> - 2019-02-15 11:37 -0800
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-16 16:02 +0100
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-21 12:21 +0100
                Re: operatore jolly mysql fmigliori <fmigliori@gmail.com> - 2019-02-21 04:33 -0800
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-21 14:37 +0100
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-21 16:27 +0100
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-21 12:39 +0100
                Re: operatore jolly mysql fmigliori <fmigliori@gmail.com> - 2019-02-21 04:43 -0800
                Re: operatore jolly mysql Enrico Maria Chellini <bitit@bitit.it> - 2019-02-21 14:38 +0100

csiph-web