iam very new to mobile jquery mobile app development.How can i connect to my database which is in godaddy and retrieve datas from one of the table and display it in tabular form in mobile.suppose databse name is funky,table name is funk_tab.so if any one can give the code for this specific problem? thank you... note:table in mobile should be scrollable as i have 10 to 11 columns in the table.
Asked
Active
Viewed 3,864 times
1 Answers
2
Jquery mobile is client side language , you cannot connect to database directly from client side langauge
You need to have page which will return json/xml result from database. Then you can parse that reponse via jquery.
Example
php
$sql="select name,id from tbl";
$res=mysql_query($sql);
while($row=mysql_fetch_array($res)){
$arr=array("name"=>$name);
}
echo $json=json_encode($arr);
javascript
var obj = jQuery.parseJSON( '{ "name": "John" }' );
alert( obj.name === "John" );
you can look the link below to parse json and show it on table
-
Thanx Man but does this ajax call support in remote urls? – user3899246 Aug 01 '14 at 12:05