Updating device informations  

  RSS

JBFelizberto
(@jbfelizberto)
Trusted Member
Joined: 2 months ago
Posts: 27
04/05/2019 2:32 pm  

Hi ,

 

I am looking for know how edit all the fields of device. Could you help me please? (I really need your help)

a) I did found how update the "groupid" 

b) I did found how update the "contact" 

c) I dont want change the category value (I mean, do not allow the user change the actual value store in DB). 

d) I dont want change the attributes value (like above). how I do to disconsider it while I run the script in category and attributes.

 

Regards

 

JB

 

$id = $Device_ID_retorno;
$name = $Device_Nome_retorno;
//???? = $Device_GRUPO_Nome_retorno;
$uniqueId = $Device_IMEI_retorno;
$phone = $Device_TELEFONE_retorno;

//contact ???  =  $Device_chip_retorno;
$Device_CHIP_retorno;
$model = $Device_MODELO_retorno;
//$category = ????
//$attributes = ?????

$c = gps::deviceUpdate($sessionId,$id,$name,$uniqueId,$phone,$model,$category,$attributes)

This topic was modified 2 weeks ago 2 times by jaimzj

Quote
jaimzj
(@jaimzj)
Guru Admin
Joined: 11 months ago
Posts: 46
06/05/2019 8:54 pm  

Could you please explain the problem in short as to what is it that you are unable to achieve? you mentioned you can update groupid and contact.

You mentioned you do not want to change or update category and attributes (Then all you got to do is not make the change)

Markers & maps are magical !!!


ReplyQuote
JBFelizberto
(@jbfelizberto)
Trusted Member
Joined: 2 months ago
Posts: 27
07/05/2019 2:23 pm  

Hi James, thank you for return.

ok, in short words:

I was using the method "devices($sessionId,$id)" to get the value of the all shield.  Users can change these value in a web page.

fields Attribut and category values  : I store them in memory to use after in my script.

the script consist in use the  deviceUpdate() method. 

my problem:

Attributes field, for example,  is a array, so I cant get tis value (hard due MY poor knowhow of PHP). I have the error message about convert array in string. 

So, how my client was in hurry, I adopted the workaround>>> get attributes value direct on MySql (query), because in that,  it is a string.

 

 

 

This post was modified 2 weeks ago by JBFelizberto

ReplyQuote
jaimzj
(@jaimzj)
Guru Admin
Joined: 11 months ago
Posts: 46
07/05/2019 9:47 pm  

Its very difficult to understand what you are saying or trying to ask.

but based on what I could gather, you are querying your attributes directly by making a database query instead of using API.

Look up information on     json_encode and json_decode   this will be the way forward for you to handle these arrays.  once you do some research on these 2, let me know with samples of what you have done.

also when you share, dont share everything, just share the part that contains your attributes handling code.

Markers & maps are magical !!!


ReplyQuote
Share:
  
Working

Please Login or Register