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)