Working in mixed languages - Search problem

Talk about Multi-Language tricks, problems, errors etc.

Moderator: alexandrleonenko

daviddelmonte
Master
Master
Posts: 159
Joined: Feb 23rd, '10, 15:06

Working in mixed languages - Search problem

Postby daviddelmonte » May 27th, '10, 06:09

Hi, my main DB is in English, but I have some words in Greek and Russian.

I can enter and update the foreign language texts.

However, when I try to search / filter based on these, I get "no records"...

Any ideas welcomed..

administrator
Site Admin
Site Admin
Posts: 6010
Joined: Jan 7th, '09, 23:18
Contact:

Re: Working in mixed languages - Search problem

Postby administrator » May 27th, '10, 08:26

Do you fields in database have UTF encoding?
Turn 'On' debug mode and see what SELECT SQL returns?

daviddelmonte
Master
Master
Posts: 159
Joined: Feb 23rd, '10, 15:06

Re: Working in mixed languages - Search problem

Postby daviddelmonte » May 27th, '10, 09:20

Hi, thanks for responding.. I'm really enjoying this grid...

So, here is the code where I get the contacts:

Code: Select all

##  *** put a primary key on the first place

$sql=" SELECT * FROM contacts";
               

##  *** set needed options and create a new class instance
$debug_mode = true;        /* display SQL statements while processing */   
$messaging = true;          /* display system messages on a screen */
$unique_prefix = "con_";    /* prevent overlays - must be started with a letter */
$dgrid = new DataGrid($debug_mode, $messaging, $unique_prefix, DATAGRID_DIR);


##  *** set encoding and collation (default: utf8/utf8_unicode_ci)
$dg_encoding = "utf8";
$dg_collation = "utf8_unicode_ci";
$dgrid->SetEncoding($dg_encoding, $dg_collation);

##  *** set data source with needed options
$default_order_field = "contacts.last_name";
$default_order_type = "ASC";
$dgrid->DataSource($db_conn, $sql, $default_order_field, $default_order_type);




Below is an image of what that produces. I will reply again with the search output...
Attachments
contact.png
screenshot of contact grid
contact.png (104.58 KiB) Viewed 2486 times

daviddelmonte
Master
Master
Posts: 159
Joined: Feb 23rd, '10, 15:06

Re: Working in mixed languages - Search problem

Postby daviddelmonte » May 27th, '10, 09:23

Here is the search output:

(But first - any idea what I did to lay out the search parameters horizontally, rather than vertically?)

search.png
Search Output
search.png (84.36 KiB) Viewed 2494 times

administrator
Site Admin
Site Admin
Posts: 6010
Joined: Jan 7th, '09, 23:18
Contact:

Re: Working in mixed languages - Search problem

Postby administrator » May 30th, '10, 07:39

First of all, you get what your SEARCH SELECT returns (do you see it?), if it return nothing, think why?
Second, all manipulations with filtering are here:
## *** filter layouts: "0" - tabular(horizontal) - default, "1" - columnar(vertical), "2" - tabular(inline)
/// $layouts = array("view"=>"0", "edit"=>"1", "details"=>"1", "filter"=>"1");
/// $dgrid->SetLayouts($layouts);

daviddelmonte
Master
Master
Posts: 159
Joined: Feb 23rd, '10, 15:06

Re: Working in mixed languages - Search problem

Postby daviddelmonte » May 30th, '10, 09:13

Thanks.. I'm still not sure what I'm doing wrong.. If I enter a name in english, I get a search result just fine...

David


Return to “Multi-Language implementation”