- This topic has 3 replies, 2 voices, and was last updated 10 years, 7 months ago by Code_A.
-
AuthorPosts
-
ejosephssMemberHi, Can anyone please give me a sample mobione program that connects and display data from mysql?
I want to create a mobile web app that will display the data from mysql database based on the value that i will choose.I have made a php-mysql connection and it is working fine using xampp But how and where can i put it on mobione to make it work.. Sorry for my beginners question.. Thanks in advance!
Code_AMemberHere is a working example using AJAX. I found this to be very helpful. Maybe you will too.
viewtopic.php?f=19&t=666
ejosephssMember@Code A wrote:
Here is a working example using AJAX. I found this to be very helpful. Maybe you will too.
viewtopic.php?f=19&t=666Thanks for your response! I cannot access this link.. https://drive.google.com/file/d/0B4ojr4ueF89DUFlRQ083VFptRkE/edit?usp=sharing
it says “Invalid Server Certificate”
Code_AMemberI have attached the example file.
I have modified the AJAX function a bit to include a few more parameters:
function sendRequest(cmd, method, data, content, sync, send){ if (send){ //post data var webReq = jQuery.ajax({url: cmd,type: method,dataType : data,contentType : content, async : sync, data : send}); }else{ var webReq = jQuery.ajax({url: cmd,type: method,dataType : data,contentType : content, async : sync}); } webReq.done(function( webText, status, jqXHR ) { // Process incoming data here response = webText; return; }); webReq.fail(function( jqXHR, status, errorThrown ) { response = false; return; }); webReq.always(function( jqXHR, status, errorThrown ) { return; }); return response; }
Here is an example of how to call the function:
var postVar = "something to pass"; var url = "http://<your_web_service>/format/json"; //example url var send = JSON.parse('{"var" : "'+ postVar +'"}'); this.response = sendRequest(url, "POST", "json","application/x-www-form-urlencoded; charset=UTF-8", false, send );
Attachments:
You must be logged in to view attached files. -
AuthorPosts