Android Tutorial Connect Android to MySQL Database Tutorial

Status
Not open for further replies.

GMan

Well-Known Member
Licensed User
Longtime User
i meant this (and this works for me)

B4X:
$databasehost = "localhost";
 

shaxboz

Member
Licensed User
Longtime User
If I use localhost, it shows me "Response from server: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)"
 

GMan

Well-Known Member
Licensed User
Longtime User
Are there any restricitons on your server (are not real familiar with that, but i also had a server that made some things impossible) - can you check with PHP-Info ?
 

tufanv

Expert
Licensed User
Longtime User
as i read in previous posts users managed to execute insert command with this lib and tutorail is that correct ?
 

tufanv

Expert
Licensed User
Longtime User
RDC is too complicated for me Erel =) i am strarting with this. Now i have my server set with php and mysql and also phpmyadmin. created my database. with name db . And created a php file that cntains the code with changing the server information to mine.
now will check if i can get the countries ty for your answer
 

tufanv

Expert
Licensed User
Longtime User
I could receive the countries list with no problem. But the retrieve time is about 2-3 seconds and if we try to use this way it would take quite long time for getting many datas from server. for example with local sql i can get 10 different strings in 1 second maybe but with this it would take about 20 30 seconds. Is there any way to fasten this proceses
 

GMan

Well-Known Member
Licensed User
Longtime User
Sometimes i have the same problems, but the reason is always the provider, which has a low data throuhgput in case of much traffic (shared server)
 

tufanv

Expert
Licensed User
Longtime User
have 2 questions.
I can receive the countries list with no problem and their populations. but when i try to execute an insert command I use for button1_click:
ExecuteRemoteQuery("INSERT INTO countries VALUES('" & "4" & "','" & "555555" & "','" & "nigeria" & "')" , COUNTRY_POPULATION)

1) what do i have to write after the coma, I am sure it must not be country population ( i am just trying to add a new country with : id , population,country)
2) it gives me internal server error for this

ty
 

tufanv

Expert
Licensed User
Longtime User
When i click the button1 Erel, it just say internal server error in the app. Nothing more
 

tufanv

Expert
Licensed User
Longtime User
Erel, I was trying to insert integer value into text field that was the problem. I could add the row. But altough the row inserted into db i got an error in my app says : JSON array expected.

what is the reason fr that ?
 

tufanv

Expert
Licensed User
Longtime User
Sorry i couldnt totally get it. Which part must i change for that
The current code expects a JSON response with the query results. In this case there is no result so you need to modify the code skip this step.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…