server-side processing turkish character search problem
server-side processing turkish character search problem
mahirc
Posts: 3Questions: 0Answers: 0
Hi i'm using datatables 1.9 for list some data and i'm using server-side processing code like this
[code]
<?php
$bayi_adi_sql ="diyarbakir";
/*
* Script: DataTables server-side script for PHP and MySQL
* Copyright: 2010 - Allan Jardine
* License: GPL v2 or BSD (3-point)
*/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Easy set variables
*/
/* Array of database columns which should be read and sent back to DataTables. Use a space where
* you want to insert a non-database field (for example a counter or static image)
*/
$aColumns = array( 'kargoGelenGiden', 'kargoGelisGidisTarih', 'kargoGonGelKisiFirma', 'kargoTeslimAlanEden','kargoFirmasi', 'id', 'calisan_adi' );
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "id";
/* DB table to use */
$sTable = $bayi_adi_sql."_kargo";
// Joins
$sJoin = 'INNER JOIN diyarbakir_calisan ON diyarbakir_kargo.teslimAlanEdenPerId=diyarbakir_calisan.calisan_kodu';
/* Database connection information */
$gaSql['user'] = "root";
$gaSql['password'] = "***";
$gaSql['db'] = "gelecek_rts";
$gaSql['server'] = "localhost";
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* If you just want to use the basic configuration for DataTables with PHP server-side, there is
* no need to edit below this line
*/
/*
* MySQL connection
*/
$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'] ) && $_GET['iDisplayLength'] != '-1' )
{
$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 $iFilteredTotal,
"aaData" => array()
);
while ( $aRow = mysql_fetch_array( $rResult ) )
{
$row = array();
for ( $i=0 ; $i
[/code]
bu when i want to search some think like word which one is have "ı,ş,ğ" the page go error. how can i fix this can anyone help me ?
edit: ı,ş,ğ
[code]
<?php
$bayi_adi_sql ="diyarbakir";
/*
* Script: DataTables server-side script for PHP and MySQL
* Copyright: 2010 - Allan Jardine
* License: GPL v2 or BSD (3-point)
*/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Easy set variables
*/
/* Array of database columns which should be read and sent back to DataTables. Use a space where
* you want to insert a non-database field (for example a counter or static image)
*/
$aColumns = array( 'kargoGelenGiden', 'kargoGelisGidisTarih', 'kargoGonGelKisiFirma', 'kargoTeslimAlanEden','kargoFirmasi', 'id', 'calisan_adi' );
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "id";
/* DB table to use */
$sTable = $bayi_adi_sql."_kargo";
// Joins
$sJoin = 'INNER JOIN diyarbakir_calisan ON diyarbakir_kargo.teslimAlanEdenPerId=diyarbakir_calisan.calisan_kodu';
/* Database connection information */
$gaSql['user'] = "root";
$gaSql['password'] = "***";
$gaSql['db'] = "gelecek_rts";
$gaSql['server'] = "localhost";
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* If you just want to use the basic configuration for DataTables with PHP server-side, there is
* no need to edit below this line
*/
/*
* MySQL connection
*/
$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'] ) && $_GET['iDisplayLength'] != '-1' )
{
$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 $iFilteredTotal,
"aaData" => array()
);
while ( $aRow = mysql_fetch_array( $rResult ) )
{
$row = array();
for ( $i=0 ; $i
[/code]
bu when i want to search some think like word which one is have "ı,ş,ğ" the page go error. how can i fix this can anyone help me ?
edit: ı,ş,ğ
This discussion has been closed.
Replies
Allan
in my table i have just 500 value, when i want to search for example "barış" it is gone to error like
Datatables warnin (table id="sample_210"): DataTablles warnin: JSON data from server could not be parsed. This is caused by a JSN formatting error.
http://s30.postimg.org/4xy26xrxd/datatable_problem.jpg