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.

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thanx Man but does this ajax call support in remote urls?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.