title: how to show data to the listview jquery mobile from mysql?
body: <p>i'm very beginner to android programming. and i have some problem that makes me feel confused.</p>
  
  <p>my problem is i want to show list of data on the listview from a table of mysql database.
  i've been trying to follow this tutorial <a href="http://coenraets.org/blog/2011/10/sample-application-with-jquery-mobile-and-phonegap/" rel="nofollow">http://coenraets.org/blog/2011/10/sample-application-with-jquery-mobile-and-phonegap/</a> and modified to suitable with my program. but my code didn't show the data from my database. </p>
  
  <p>please help me. thanks</p>
  
  <p>this is some of my code
  this is my html code</p>
  
  <pre><code>&lt;ol id="top10list" data-role="listview" data-theme="a"&gt; &lt;/ol&gt;
  </code></pre>
  
  <p>and this is my php code</p>
  
  <pre><code>&lt;?php
  include 'config.php';
  
  $sql = "select m.namamovie, m.description from top10 t left outer join movie m on t.idmovie = m.idmovie";
  
  try {
      $dbh = new PDO("mysql:host=$dbhost;dbname=$dbname", $dbuser, $dbpass);
      $dbh-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
      $stmt = $dbh-&gt;prepare($sql);
      $stmt-&gt;bindParam("idtop10", $_GET[idtop10]);
      $stmt-&gt;execute();
      $top10 = $stmt-&gt;fetchObject();
      $dbh = null;
      echo '{"item":'. json_encode($top10) .'}';
  } catch(PDOException $e) {
      echo '{"error":{"text":'. $e-&gt;getMessage() .'}}';
  }
  ?&gt;
  </code></pre>
  
  <p>and this is my javascript code</p>
  
  <pre><code>var serviceUrl ="..\MovieManiac1.0\assets\www\";
  var top10s;
  
  $('#top10list').bind('pageinit', function(event) {
      getTop10List();
  });
  
  function getTop10List() {
      $.getJSON(serviceURL + 'gettop10.php', function(data) {
      $('#top10list li').remove();
      top10s = data.items;
      $.each(top10s, function(index, top10) {
          $('#top10list').append('&lt;li&gt;&lt;a href="top10.php?id=' + top10.idmovie + '"&gt;' + '&lt;h4&gt;' + movie.moviename + '&lt;/h4&gt;' + '&lt;p&gt;' + movie.moviename + '&lt;/p&gt;' + '&lt;p&gt;' + movie.description + '&lt;/p&gt;'+ '&lt;/a&gt;&lt;/li&gt;'); 
      $('#top10list').listview('refresh');
      });
      }
  }
  </code></pre>