Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1077337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:33:34+00:00 2026-05-16T21:33:34+00:00

i have a page post2.php which prints the json array like { page: 1,

  • 0

i have a page post2.php which prints the json array like

{
  page: 1,
  total: 239,
  rows: [{
      id: '239',
      cell: ['239', 'ZW', 'ZIMBABWE', 'Zimbabwe', 'ZWE', '716']
    },
    {
      id: '238',
      cell: ['238', 'ZM', 'ZAMBIA', 'Zambia', 'ZMB', '894']
    },
    {
      id: '237',
      cell: ['237', 'YE', 'YEMEN', 'Yemen', 'YEM', '887']
    },
    {
      id: '236',
      cell: ['236', 'EH', 'WESTERN SAHARA', 'Western Sahara', 'ESH', '732']
    },
    {
      id: '235',
      cell: ['235', 'WF', 'WALLIS AND FUTUNA', 'Wallis and Futuna', 'WLF', '876']
    },
    {
      id: '234',
      cell: ['234', 'VI', 'VIRGIN ISLANDS, U.S.', 'Virgin Islands, U.s.', 'VIR', '850']
    },
    {
      id: '233',
      cell: ['233', 'VG', 'VIRGIN ISLANDS, BRITISH', 'Virgin Islands, British', 'VGB', '92']
    },
    {
      id: '232',
      cell: ['232', 'VN', 'VIET NAM', 'Viet Nam', 'VNM', '704']
    },
    {
      id: '231',
      cell: ['231', 'VE', 'VENEZUELA', 'Venezuela', 'VEN', '862']
    },
    {
      id: '230',
      cell: ['230', 'VU', 'VANUATU', 'Vanuatu', 'VUT', '548']
    }
  ]
}

and in zend views i am trying to do like

$(document).ready(function() {

  $("#flex1").flexigrid({
    url: '/public/**post2.ph**p',
    dataType: 'json',
    colModel: [{
        display: 'ID',
        name: 'id',
        width: 40,
        sortable: true,
        align: 'center'
      },
      {
        display: 'ISO',
        name: 'iso',
        width: 40,
        sortable: true,
        align: 'center'
      },
      {
        display: 'Name',
        name: 'name',
        width: 180,
        sortable: true,
        align: 'left'
      },
      {
        display: 'Printable Name',
        name: 'printable_name',
        width: 120,
        sortable: true,
        align: 'left'
      },
      {
        display: 'ISO3',
        name: 'iso3',
        width: 130,
        sortable: true,
        align: 'left',
        hide: true
      },
      {
        display: 'Number Code',
        name: 'numcode',
        width: 80,
        sortable: true,
        align: 'right'
      }
    ],
    buttons: [{
        name: 'Add',
        bclass: 'add',
        onpress: test
      },
      {
        name: 'Delete',
        bclass: 'delete',
        onpress: test
      },
      {
        separator: true
      },
      {
        name: 'A',
        onpress: sortAlpha
      },
    ],
    searchitems: [{
        display: 'ISO',
        name: 'iso'
      },
      {
        display: 'Name',
        name: 'name',
        isdefault: true
      }
    ],
    sortname: "id"
    sortorder: "asc",
    usepager: true,
    title: 'Countries',
    useRp: true,
    rp: 10,
    showTableToggleBtn: true,
    width: 700,
    height: 255
  });
});

this prints the flexigrid layout well.. but never gets the data.it keeps telling processing.
is there some problem in the json array or in the flexigrid calling… or in zend with json.

any suggestions to try out for this problem?

i tried out like this also

$.post("/public/server_processing1.php",{},function(data){
alert('hai');
alert(data);
}, "json");

and its not even alerting hai ..

full post2.php code is like this

<?
error_reporting(1);
function runSQL($rsql) {
        $hostname = "localhost";
        $username = "root";
        $password = "root";
        $dbname   = "hms1";
        $connect = mysql_connect($hostname,$username,$password) or die ("Error: could not connect to database");
        $db = mysql_select_db($dbname);
        $result = mysql_query($rsql) or die ('test');
        return $result;
        mysql_close($connect);
}

function countRec($fname,$tname,$where) {
$sql = "SELECT count($fname) FROM $tname $where";
$result = runSQL($sql);
while ($row = mysql_fetch_array($result)) {
return $row[0];
}
}
$page = $_POST['page'];
$rp = $_POST['rp'];
$sortname = $_POST['sortname'];
$sortorder = $_POST['sortorder'];

if (!$sortname) $sortname = 'pa_name';
if (!$sortorder) $sortorder = 'desc';
                if($_POST['query']!=''){
                        $where = "WHERE `".$_POST['qtype']."` LIKE '%".$_POST['query']."%' ";
                } else {
                        $where ='';
                }
                if($_POST['letter_pressed']!=''){
                        $where = "WHERE `".$_POST['qtype']."` LIKE '".$_POST['letter_pressed']."%' ";
                }
                if($_POST['letter_pressed']=='#'){
                        $where = "WHERE `".$_POST['qtype']."` REGEXP '[[:digit:]]' ";
                }
$sort = "ORDER BY $sortname $sortorder";

if (!$page) $page = 1;
if (!$rp) $rp = 10;

$start = (($page-1) * $rp);

$limit = "LIMIT $start, $rp";
$sql = "SELECT pa_id,pa_name,pa_pd_patient_id,pa_name FROM patient_appointment $where $sort $limit";
$result = runSQL($sql);

$total = countRec('pa_id','patient_appointment',$where);

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header("Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" );
header("Cache-Control: no-cache, must-revalidate" );
header("Pragma: no-cache" );
header("Content-type: text/x-json");
$json = "";
$json .= "{\n";
$json .= "page: $page,\n";
$json .= "total: $total,\n";
$json .= "rows: [";
$rc = false;
while ($row = mysql_fetch_array($result)) {
if ($rc) $json .= ",";
$json .= "\n{";
/*$json .= "cell:['".$row['pa_name']."'";
$json .= ",'".addslashes($row['time'])."'";
$json .= ",'".addslashes($row['pa_um_id'])."'";
$json .= ",'".addslashes($row['pa_pd_patient_id'])."']";*/
$json .= "id:'".$row['pa_id']."',";
$json .= "cell:['".$row['pa_id']."','".$row['pa_name']."'";
$json .= ",'".addslashes($row['pa_pd_patient_id'])."']";

$json .= "}";
$rc = true;
}
$json .= "]\n";
$json .= "}";
echo $json;
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T21:33:34+00:00Added an answer on May 16, 2026 at 9:33 pm

    I’m guessing you’re using IE browser. If so IE does not like <div id="flex1"></div> container. Change it to <table id="flex1"></table> and all should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a php page which contains a form. Sometimes this page is submitted
I have an HTML form that submits to a PHP page which initiates a
I have a PHP website in which, when a member visits a page, a
Okay, so I have my post.php page. If you are not logged in, you'll
I have this jQuery script var dataString = class_id=+class_id; $.ajax({ type: POST, url: page.php,
I have my index page which posts a single entry instead of the usual
I have a page set up to show only posts from one category, which
I have next code block: $.post('page.php', function(data) { //data - full page info });
I have created a page index.php with a lot of divs and I need
I am submitting from a form to another php page which is supposed to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.