MySQL interface tutorial will not work!

Hi, I am trying to simply follow the tutorial for the ai2 mysql interface with the php file.
I have tried 2 different hosting services (000webhost Databases) and (infinityfree database)
the configuration for connection I have copied directly from the host site DBname user password etc.
and nothing seems to work.
I've changed the URL to the location of the php script in the server in ai2
I've made the sqlkey to the exact same word in the php file and in ai2 (I left it as "secret" just for a test)
when i press create table in the app i get ERROR 302 Found... the document has moved to 'here'
'here looks like a link but it will not click.
Im using the ai companion on my phone as normal when im making apps.

ever since fusion tables have gone i have never been able to get a database working.
Why is it made to be so difficult?
I'm losing the plot over this, i just need a few columns of data to read and write to. it's insane!
Please help

My guess is, you are following this tutorial?

What happens, if you call that URL in a browser?


ah, page not found happens....
I will double check everything again now. usually my server uploads are instant for websites etc.
l'll double check

Okay i moved the php file from a sub folder closer to the root and got it to return "bad request" in the browser, which is a step forward from 404 not found. I also pulled up some html and jpg files i have in the same directory and they all display fine.
I put the tested php url into ai2 and when i click create table i get
Error 500 http/1.1 internal server error 43531
I'm guessing i have more issues on the server side?

If i press create table again i get
Cannot parse text argument to "list from csv table" as a CSV-formatted table
Note: You will not see another error reported for 5 seconds.

this looks good, because this is the message which will be returned from the php script, if you call it directly from a browser... :wink:
now try again from App Inventor

see Q4 about what to do App Inventor Tutorials and Examples: MySQL | Pura Vida Apps


1 Like

Thanks for the reply.
I have displayed the response content in the results label as you suggest and it has lead me onto Q5 of the tutorial which is the javascript problem, I now realise that infinityfree will not work. I had my suspicions of this earlier which is why i tried 000webhost but that didn't seem to work either.
I struggled with the DB Address setting in the php file for this as 000webhost says to make it "localhost" and i couldn't find a URL in the same way as infinityfree.
I'll go back and concentrate on 000webhost for now and see where i get to again.

I can't believe it, It's now working with 000webhost.
the url to the php file is just ''/mysql.php
using 'localhost' in the php file
it created the table straight away.
I don't know why i've had such a hard time with this but it's done and im going to bed.
Many thanks for your help!!!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.