Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > it.comp.www.php > #22574
| From | Enrico Maria Chellini <bitit@bitit.it> |
|---|---|
| Newsgroups | it.comp.www.php |
| Subject | Re: operatore jolly mysql |
| Date | 2019-02-15 15:08 +0100 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <20190215150818.1aa17f8a@nntp.aioe.org> (permalink) |
| References | (7 earlier) <20190214120055.4b5f1b19@nntp.aioe.org> <20190214162342.51129c53@nntp.aioe.org> <gclhusFd1r8U1@mid.individual.net> <20190215124737.284e8c44@nntp.aioe.org> <20190215140716.4753b5d6@nntp.aioe.org> |
Il giorno Fri, 15 Feb 2019 14:07:16 +0100
Enrico Maria Chellini <bitit@bitit.it> ha scritto:
così funziona ma non so se ha falle di sicurezza
$pa=0;
$pb=9;
$wheres = [];
$condizioni =[];
if (!empty($garage)) {
$wheres[] = $garage;
$condizioni[]='garage';
}
if (!empty($terrazza)) {
$wheres[] = $terrazza;
$condizioni[]='terrazza';
}
if (!empty($giardino)) {
$wheres[] = $giardino;
$condizioni[]='giardino';
}
if (!empty($vani)) {
$wheres[] = $vani;
$condizioni[]='vani';
}
if (!empty($bagni)) {
$wheres[] = $bagni;
$condizioni[]='bagni';
}
if (!empty($classe)) {
$wheres[] = $classe;
$condizioni[]='classe';
}
if (!empty($condizione)) {
$wheres[] = $condizione;
$condizioni[]='condizione';
}
if (!empty($piscina)) {
$wheres[] = $piscina;
$condizioni[]='piscina';
}
if (!empty($occupato)) {
$wheres[] = $occupato;
$condizioni[]='occupato';
}
if (!empty($tipologia)) {
$wheres[] = $tipologia;
$condizioni[]='idTipologia';
}
if (!empty($categoria)) {
$wheres[] = $categoria;
$condizioni[]='categoria';
}
if (!empty($pauto)) {
$wheres[] = $pauto;
$condizioni[]='pauto';
}
if (!empty($piano)) {
$wheres[] = $piano;
$condizioni[]='piano';
}
if (!empty($npiani)) {
$wheres[] = $npiani;
$condizioni[]= 'npiani';
}
if (!empty($online)) {
$wheres[] = $online;
$condizioni[]='online';
}
//$query = "select * from dati where ";
$query = implode(
' AND ',
array_map(
function($k) { return $k . '= ?'; },
$condizioni
)
);
$sqll = $n2qdb->prepare('SELECT * FROM ((articoli INNER JOIN
tipologie ON articoli.idTipologia=tipologie.idTipologia) INNER JOIN
luogo ON articoli.idLuogo=luogo.idLuogo) INNER JOIN bookings_items ON
articoli.idArticoli=bookings_items.id_ref_external WHERE '.$query.'
ORDER BY occasione DESC, priorita ASC LIMIT '.$pa.', '.$pb.'');
$sqll->execute($wheres);
$rqll = $sqll->fetchAll();
Back to it.comp.www.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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