title: mysql PDO doesnt work
body: <p>I've a little problem here..</p>
  
  <p>I am using jquery easy UI to get data from mysql and then write a table in my php application..</p>
  
  <p>nah.. the problem is.. my code or my query doesn't work..</p>
  
  <p>When I am using my old mysql_connect, my code works well... but when I try to write it to mysql, I get nothing...</p>
  
  <p>Here is my old code:</p>
  
  <pre><code>$page = isset($_POST['page']) ? intval($_POST['page']) : 1;
      $rows = isset($_POST['rows']) ? intval($_POST['rows']) : 10;
      $offset = ($page-1)*$rows;
  
      $result = array();
  
      $conn = mysql_connect('127.0.0.1','root','');
      mysql_select_db('colosus',$conn);
  
      $rs = mysql_query("select count(*) from user");
      $row = mysql_fetch_row($rs);
      $result["total"] = $row[0];
  
      $rs = mysql_query("select * from user limit $offset,$rows");
  
      $rows = array();
      while($row = mysql_fetch_object($rs)){
          array_push($rows, $row);
      }
      $result["rows"] = $rows;
  
      echo json_encode($result);
  </code></pre>
  
  <p>and its the PDO query code...</p>
  
  <pre><code>$page = isset($_POST['page']) ? intval($_POST['page']) : 1;
      $rows = isset($_POST['rows']) ? intval($_POST['rows']) : 10;
      $offset = ($page-1)*$rows;
  
      $result = array();
  
  
  
      $rs = $db-&gt;query("select count(*) from user");
      $row = $rs-&gt;fetch(PDO::FETCH_NUM);
      $result["total"] = $row[0];
  
      $rs = $db-&gt;query("select * from user as u, leveluser as l where u.idLevelUser = l.idLevelUser limit $offset,$rows");
  
      $rows = array();
      while($row = $rs-&gt;fetch(PDO::FETCH_OBJ)){
          array_push($rows, $row);
      }
      $result["rows"] = $rows;
  
      echo json_encode($result);
  </code></pre>
  
  <p>The last query (PDO) doesn't work.. I dont know why.. anybody can help me???</p>