Tinywebdb PHP script

Hi,
I tried to build my Tinydbweb on a host space following this topic https://groups.google.com/g/mitappinventortest/c/wi8w1x6ljPc/m/JCq9rDYIBwAJ
Values are correctly saved to the .html db, but when I use TinyWebDB.GetValue block , I receive error "Value of type java.lang.String cannot be converted to JSONArray."

I'm sure the PHP script sends for example ["VALUE","TAG1",66] as response.

What could be the issue ?

According to this service http://tinywebdb.appinventor.mit.edu/ , the response could be right.

Thank you

Show your blocks

[edit] I have just tested the php file on my server, everything seems to work fine, storing either a string or a list, and these return fine, as a string or a list.


(1.4 KB)

tinywebdb3.php.txt (1.6 KB)

Relevant blocks and phpfile

That is a very inefficient way of doing things. Why not save all your values to a single list, and store that.

You can then set the listitems to textboxes on its return.

Something like this:

I will test your php file.

hmmm, you modified the return section of the php file, stripping \ from tag and value. These are needed by the tinywebdb blocks to return your string or list correctly.

Here is an anglicised version of the php file, fully tested...(

if it ain't broke, don't fix it

)

engkio4twdb.php.txt (1.4 KB)

Thank you, I'll take a look at your blocks and your PHP script.

The unmodified PHP script (without stripping ) didn't work also.
My blocks worked with App Inventor TinyDbweb Demo Service

I used your PHP script, with my old inefficient block.
Values are saved on DB correctly.

Cattura

But reading values I received the error "The web server returned a garbled value for the tag xxxxxx" for every tag.

Trying with your blocks (using lists) , values are saved correctly

CONF:["1","2","3","4","5","6","7","8","9"]:

But reading values same error "The web server returned a garbled value for the tag xxxxxx" for every tag.

Switching to AppInventor TinyWebDb Demo , no erorrs and blocks are very faster than my olds one

So, I don't understand what is the matter with PHP script/server

I have sent you a PM

also show your latest blocks

Your server is OK ad super fast. No errors.
Something wrong on my PHP server ?

Could be. My php is running on version 7.2.24 and the server is ubuntu 18.04 LTS.

I will also test on my shared hosting, see how that goes.

ok, what I could check on server ?
Can I post PHP.ini ?

Also works fine on my shared hosting:

Guess you need to check your server and php installations (permissions as well)

buongiorno
scusami TIMA12 ma faccio molta fatica con l inglese, ho girato con le ricerche ma non ho trovato molto di abbastanza chiaro, volevo chiederti , mi sembra di aver capito che per usare il tinydbweb , il file "engkio4twdb.php.txt" (o qualche file simile, ma..... .php.txt ? c'e qualcosa di sbagliato nell'estensione ?) va inserito sul server. ma c'e' bisogno di qualche altra cosa ? avevo una mezza intenzione di prendere un sito gratuito
sono secoli che non uso il php, come altri linguaggi e non è facilissimo ricominciare

Good morning

Sorry, I wrote to you in Italian.

Sorry, TIMA12, but I'm really struggling with English. I've been searching but haven't found anything clear enough. I wanted to ask you. I think I understand that to use tinydbweb, the file "engkio4twdb.php.txt" (or some similar file, but... .php.txt? Is there something wrong in the extension?) needs to be placed on the server. But is there anything else needed? I was half-minded about getting a free site.
It's been ages since I used PHP, like other languages, and it's not exactly easy to start over.
There are two words I can't translate. Could someone explain them to me? coerce and yail

The .txt extension is added so that the file can be uploaded here on the community.

Upload it to your server, and remove the .txt extension from the filename so that is just:

engkio4twdb.php

You need a working php configuration, and access permissions to write to a file.

Coerce means to change the data type of something to make it fit somewhere.

The only analogies I can think of at the moment are too rude for this board.

Yail is one of the internal language codes buried in AI2. It's an acronym. If you see yail code, you are somewhere you shouldn't be.


Thanks
Right, I used something like that when I sent my program updates via email. By changing the extension, the email accepted everything.
And where should I look for PHP configuration and access permissions?
Thanks also to ABG for the reply.
Sorry, but as you get older, you don't really feel like searching in a thousand places when I often can't find what I'm looking for. Is there a complete guide somewhere with choices by topic, without having to bother you all the time?
grazie
giusto, usavo qualcosa del genere quando mandavo gli aggiornamenti dei miei programmi tramite mail , trasformando l estensione la mail accettava tutto
e per la configurazione php e l accesso ai permessi dove dovrei cercare ?
grazie anche a ABG per la riposta
scusatemi ma quando si invecchia non si ha molta voglia di cercare in mille posti quando spesso non riesco a trovare quello che cerco. ma esiste una guida completa con scelte per argomento da qualche parte , senza dovervi disturbare continuamente ?

Search this board for FAQ Tinywebdb

If you have a shared hosting provider, then PHP should already be setup and running. If it is your own built server then you will need to install PHP. Search the interweb for a guide on how to do this.

Unless you really do only have minimal requirements for your data storage (tag:value storage and retrieval) you might consider Google Sheets, CloudDB or Firebase for your online data requirements.