Problem with IE. No records.
Problem with IE. No records.
I have a mysql/php connection in Datatable sample and everything works fine with Firefox. Records are displayed properly. But, the same page on IE give me a message 'Nothing found' (sZeroRecords).
Has somebody idea what would be a problem?
Has somebody idea what would be a problem?
This discussion has been closed.
Replies
How do you pass data from server, I mean do you use something like this
var tableData = eval( '(' + rowsFromServer + ')' );
before sending it to table, in my case the '(' ')' do the work for IE :)
I'm not sure about passing. This is a PHP code:
$gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) or
die( 'Could not open connection to server' );
mysql_select_db( $gaSql['db'], $gaSql['link'] ) or
die( 'Could not select database '. $gaSql['db'] );
/* Paging */
$sLimit = "";
if ( isset( $_GET['iDisplayStart'] ) )
{
$sLimit = "LIMIT ".mysql_real_escape_string( $_GET['iDisplayStart'] ).", ".
mysql_real_escape_string( $_GET['iDisplayLength'] );
}
/* Ordering */
if ( isset( $_GET['iSortCol_0'] ) )
{
$sOrder = "ORDER BY ";
for ( $i=0 ; $i
Allan
{
$sOutput .= "[";
$sOutput .= "'".$aRow['proizvod_naziv']."',";
$sOutput .= "'".$aRow['proizvod_sifra']."',";
$sOutput .= "'".$aRow['proizvod_model']."',";
$sOutput .= "'".$aRow['proizvod_vpc_cijena']."',";
$sOutput .= "],"; // there is the spot where you dont form data well, don`t add comma to last record from dbase :)
}
$i = 0;
while ( $aRow = mysql_fetch_array( $rResult ) )
{
$i++;
$sOutput .= "[";
$sOutput .= "'".$aRow['proizvod_naziv']."',";
$sOutput .= "'".$aRow['proizvod_sifra']."',";
$sOutput .= "'".$aRow['proizvod_model']."',";
$sOutput .= "'".$aRow['proizvod_vpc_cijena']."',";
$sOutput .= "]";
if($i < $iTotal)
$sOutput .= ",";
}
Allan, sorry, how to get JSON output?
@krunoslav - to get the json output - the easiest way is using something like Firebug... But since you are using IE, what you can do is load the server_processing.php page in your web-browser (remember to add the relavant GET variables, and it will pop up in your browser.
Do you have a link you can provide?
Allan
True, I wasnt paying enough attention. :)
There is lite version of firebug that can be run under IE :)
http://getfirebug.com/lite.html
there is a link:
http://www.pramat.hr/admin/prodaja/grid4/examples/examples_support/server_processing.php
strange thing is that when you click on third column records displayed, but when you click on first and second column they gone
Thanks for the link - your json is definitely not valid which is what is causing you issues. There are a couple of problems:
1. The number of entries in the array changes from between 4 and 6
2. They are not escaped
3. There is a missing quote mark on one of the columns.
Try altering your server-side code so that it does parse correct json.
Regarding the third column, it suspect that this is just luck - the server is outputting valid json at this point because the ten rows it is limited to happen not to have the problems mentioned above.
Allan
This is definitely cause of my problems.
Thank you for your efforts and for great software too...
Luda Ameba,
thanks for your help , too