0

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.

user3899246
  • 3
  • 1
  • 3

1 Answers1

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

Display JSON Data in HTML Table

Community
  • 1
  • 1
sumit
  • 15,003
  • 12
  • 69
  • 110