title: jquery mobile with php?
body: <p>I'm trying to learn jquery mobile and I was wondering if jquery mobile can be used with PHP as if I'm building a regular website? </p>
  
  <p>with jquery mobile tags are almost the same, but they use tags such as data-role,</p>
  
  <p>indext.html</p>
  
  <pre><code>&lt;div data-role="header"&gt;
  &lt;div data-role="content"&gt;
  content page
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Can I do something like</p>
  
  <p>index.html</p>
  
  <pre><code>&lt;div data-role="header"&gt;
  &lt;div data-role="content"&gt;
  &lt;?php echo $content; //this content will be populated by mysql
  ?&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Or would I have to use ajax to get the content?</p>
  
  <p>index.html</p>
  
  <pre><code>$(document).ready(function(){
  $.ajax({
    url: "test.html",
    success: function(data){
      $('.page1').html(data);
    }
  });
  });
  
  
  &lt;div data-role="header"&gt;
  &lt;div data-role="content" class='page1'&gt;
  &lt;?php echo $content; //this content will be populated by mysql
  ?&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>test.html</p>
  
  <pre><code>&lt;?php
  $sql = mysql_query("SELECT * FROM test");
  while($q = mysql_fetch_array($sql)){
  $content = $q['content'];
  echo $content;
  }
  ?&gt;
  </code></pre>