Hi All,
Im new to PHP and right now im facing this problem.
I have tried Erel's example to connect to remote DB by creating a database in free hosting webserver.
Erel's example from https://www.b4x.com/android/forum/threads/connect-android-to-mysql-database-tutorial.8339/
I have the PHP file hosted in there also. the table countries already there with 2 rows in it.
but when i run the app in B4A will show error something like this :
Im not sure what cause this problems. can someone help ?
thanks in advance.
regards,
Im new to PHP and right now im facing this problem.
I have tried Erel's example to connect to remote DB by creating a database in free hosting webserver.
Erel's example from https://www.b4x.com/android/forum/threads/connect-android-to-mysql-database-tutorial.8339/
I have the PHP file hosted in there also. the table countries already there with 2 rows in it.
but when i run the app in B4A will show error something like this :
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
Response from server: <html><body><script type="text/javascript" src="/aes.js" ></script><script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("fe17c9c74924c548c24c67574444650b");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; location.href="http://www.rumahkostum.unaux.com/countries.php?i=1";</script><noscript>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support</noscript></body></html>
Error occurred on line: 58 (Main)
java.lang.RuntimeException: JSON Array expected.
at anywheresoftware.b4a.objects.collections.JSONParser.NextArray(JSONParser.java:62)
at anywheresoftware.b4a.samples.mysql.main._jobdone(main.java:502)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA$2.run(BA.java:360)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Im not sure what cause this problems. can someone help ?
thanks in advance.
regards,