How to connect app to an online mysql database


Please can someone give me Information about how I can connect my app to a online server mysql database without compromising with Security ?



I try that method but It is giving a very long File with response code 200
don’t know the reason


try the example app and php scripts from there
that solution does not return a file, but some text …
and in case you get issues, you might want to provide some more details…


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.


Sir I wanna ask that is this method safe?


read chapter “PHP Script” here

… as the example is designed, this update still will not prevent from SQL Injection attacks, because all queries coming from App Inventor will be executed. You will have to use prepared statements or stored procedures to be on the safe side. See also: SQL Injection Prevention Sheet or do a Google Search do find more about SQL Injections. Also it is recommended to do at least some data validation on the App Inventor side.

first get it running as it is, then adjust it to your needs


Ok I understand thanq sir


Hi @Taifun sir
I am using your method of connecting to online MySQL database but getting a major error that whenever I want to fetch a multi-line statement (that contains \n) it gives only the statement before \n and leave all others, it even leaves all the values after that text column
What is the problem please help me


as the php script is set up currently, commas and \n are reserved, do not use them in your columns
commas are uses as column delimiter, \n is used as row delimiter
you might want to adjust the php script to your needs