Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > it.comp.www.php > #21328
| Path | csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Alessandro Pellizzari <shuriken@amiran.it> |
| Newsgroups | it.comp.www.php |
| Subject | Re: query cerca valore superiore |
| Date | 28 Dec 2016 19:00:37 GMT |
| Lines | 24 |
| Message-ID | <ecigelFean8U1@mid.individual.net> (permalink) |
| References | <c955c779-b6c3-4737-af3d-65606f7ddbad@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 8bit |
| X-Trace | individual.net exV9K/DXsEXMmjuHsrJHswJNe+HCFLCvxhLzWmHGEy+f9raGk= |
| Cancel-Lock | sha1:J/PgNhq4zgcppJJ/2d0/PI/pmfE= |
| User-Agent | Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) |
| Xref | csiph.com it.comp.www.php:21328 |
Show key headers only | View raw
Il Wed, 28 Dec 2016 07:38:44 -0800, Giovanni Artera ha scritto: > ho una query di questo tipo > > $box_tassato = max($box_total_weight, $box_volumetrico); > > // CALCULATION OF RIGHT TRANSPORT COST $query_transport="SELECT * FROM > `transport_costs_import` WHERE Zone_id ='7' AND weight = '$box_tassato' > "; $result_transport_cost= mysqli_query($CGCconn, $query_transport); > ma se weight non esiste deve darmi il valore appena superiore, cioè se > $box_tassato = 32 e questo non esiste nella colonna ma il numero appena > superiore è 35 farmi la query corretta Non sono sicuro di aver capito cosa hai dentro il DB, ma prova questa: select * from transport_costs_import where Zone_id='7' and weight >= $box_tassato order by weight; Spero che il tuo weight sia salvato come numero nel DB, perché dalla tua sintassi sembra una stringa, e in quel caso sarà difficile farci qualcosa. Bye.
Back to it.comp.www.php | Previous | Next — Previous in thread | Find similar | Unroll thread
query cerca valore superiore Giovanni Artera <jesolo.sun@gmail.com> - 2016-12-28 07:38 -0800 Re: query cerca valore superiore Alessandro Pellizzari <shuriken@amiran.it> - 2016-12-28 19:00 +0000
csiph-web