o = 30; $query .= " LIMIT ".$from.",".$to; $result = mysql_query($query) or die("SQL Error 1: " . mysql_error()); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $customers[] = array( 'CompanyName' => $row['CompanyName'], 'ContactName' => $row['ContactName'], 'ContactTitle' => $row['ContactTitle'], 'Address' => $row['Address'], 'City' => $row['City'] ); } echo json_encode($customers); --list.php-- echo $_POST["list"]; -->