Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > it.comp.www.php > #21334
| From | Enrico Maria Chellini <bitit@bitit.it> |
|---|---|
| Newsgroups | it.comp.www.php |
| Subject | Re: passaggio di un array in un link |
| Date | 2016-12-29 19:56 +0100 |
| Organization | www.bitit.it |
| Message-ID | <o43m8t$1cth$1@gioia.aioe.org> (permalink) |
| References | <o43b44$p4q$1@gioia.aioe.org> <eckr76F3krU1@mid.individual.net> |
Alessandro Pellizzari wrote:
> Il Thu, 29 Dec 2016 16:46:13 +0100, Enrico Maria Chellini ha scritto:
>
>> ho un $arry contente dei valori risultati da una query
>>
>> questi valori vanno passati in un link.php?array=$array
>>
>> ma il risultato che ho รจ Array to string conversion in device.php on
>> line 100
>>
>> come faccio a far passare i valori?
>
> Intanto devi decidere come li vuoi nell'URL e vedere come li hai
> nell'array, poi devi trovare il modo per encodarli.
>
> Fai un esempio di cosa hai nell'array e di cosa vorresti vedere nell'URL.
>
> Bye.
$device="SELECT * FROM ((sysSetDevice INNER JOIN sysambient ON
sysSetDevice.idsysAmbient=sysambient.idsysAmbient) INNER JOIN system ON
sysambient.idSystem=system.idSystem) INNER JOIN sysdevice ON
sysambient.idDeviceType=sysdevice.idDeviceType WHERE
sysSetDevice.idsysAmbient='$ida' ";
foreach($rvdb->query($device) as $rdevice)
{
$idd=$rdevice['idsysAmbient'];
$nameLogTab=$rdevice['log_tab'];
$deviceSetName_local=$rdevice['deviceSetName_local'];
$logFieldName=$rdevice['logFieldName'];
$logFieldType=$rdevice['logFieldType'];
$set=$rdevice['set'];
$logTab=$rdevice['log_tab'];
//array
$fieldArry [$logFieldName] =$logFieldType;
//risultato array:
Array ( [RESIDUAL_OXYGEN] => 2 [AIR_PRESSURE] => 2 [VACUOM] => 2
[NITROGEN_PRESSURE] => 2 [WORK_TIME] => 2 [RESIDUAL_OXYGEN_AVERAGE] => 3
[AIR_TEMPERATURE] => 3 [CABINET_TEMPERATURE] => 3 [AL21] => 0 [AL22] => 0
[AL2] => 0 [AL3] => 0 [AL1] => 0 [AL8] => 0 [AL4] => 0 [AL20] => 0
[AL20_STOP] => 0 [AL20_ALLERT] => 0 [AL7] => 0 [AL11] => 0 [AL25] => 0
[AL26] => 0 [STATE_0] => 0 [STATE_8] => 0 [ADSORPTION] => 3 [FLOW] => 3
[AVERAGE_FLOW] => 3 [TIMESTAMP] => 2 )
// link di trasmissione:
getDeviceLog.php?ida=".$idd."&tab=".$nameLogTab."&fieldArry=".$fieldArry;
//di la mi prendo l'arry per selezionare nella query i campi che miservono.
$cat="SELECT * FROM $tab ORDER BY idLog DESC ";
foreach($rvdb->query($cat) as $rcat){
foreach ($fieldArry as $field => $type)
echo $field . ' = ' . $type . '<br />$'.$field=$rcat[$field];
troppa fantasia? :D
Back to it.comp.www.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
passaggio di un array in un link Enrico Maria Chellini <bitit@bitit.it> - 2016-12-29 16:46 +0100
Re: passaggio di un array in un link Alessandro Pellizzari <shuriken@amiran.it> - 2016-12-29 16:16 +0000
Re: passaggio di un array in un link Enrico Maria Chellini <bitit@bitit.it> - 2016-12-29 19:56 +0100
Re: passaggio di un array in un link Alessandro Pellizzari <shuriken@amiran.it> - 2016-12-30 08:23 +0000
Re: passaggio di un array in un link Enrico Maria Chellini <bitit@bitit.it> - 2016-12-30 09:55 +0100
Re: passaggio di un array in un link Enrico Maria Chellini <bitit@bitit.it> - 2016-12-30 10:13 +0100
Re: passaggio di un array in un link Leonardo Serni <lserni@gmail.com> - 2016-12-29 19:30 +0100
Re: passaggio di un array in un link Enrico Maria Chellini <bitit@bitit.it> - 2016-12-29 19:46 +0100
csiph-web