Android Question Mysql and B4A

Seven07

New Member
Hello this is my first time using basic4android. I am a high school student and I wanted to develop an application for my research but I am having a hard time integrating sql to my code. I am using xampp for mysql and I wanted to ask, where do you upload your php files online??

and if you have a code or app example for integrating mysql to b4a please help thanks
 

KMatle

Expert
Licensed User
Longtime User
You shouldn't use PHP at all.

No. It always depends on the solution.

and if you have a code or app example for integrating mysql to b4a please help thanks

See here as a start (if you want to use PHP as a middleare. Big plus on PHP is that it is supported on any (even cheap hosted servers): https://www.b4x.com/android/forum/threads/updated-mysql-php-example.96790/

It's all about calling a php script running under Apache on a server (XAMPP is for test only). In that script you open a connection to the MySQL DB and then execute statements. Return will be an associated array. This will be returned to your app (JSON formatted would be ideal).
 
Upvote 0

Bladimir Silva Toro

Active Member
Licensed User
Longtime User
Hello @Seven07

The same question came to mind I just started with B4A.

I can tell you that there are 3 basic ways of connecting B4A to MySQL and they are the following;

1. Direct Connection by JDBC, link: https://www.b4x.com/android/forum/threads/jdbcsql-directly-connect-to-remote-databases.84016/

2. Connection by jRDC2, link: https://www.b4x.com/android/forum/t...ation-of-rdc-remote-database-connector.61801/

3. WebService using okhttputils, Link: https://www.b4x.com/android/forum/threads/b4x-okhttputils2-with-wait-for.79345/

My recommendation for a student would be the 1st way connecting directly with JDBC

If you have a problem ask, but read a lot first.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Direct Connection also
 
Upvote 0
Top