Forum Webscript.Ru

Программирование => JavaScript & JScript => Тема начата: stivi от 06 Сентября 2006, 11:56:42

Название: quick search - cyrillic
Отправлено: stivi от 06 Сентября 2006, 11:56:42
index.html




 Proba
 
 





 
 

 






select_load.php

foreach ($HTTP_GET_VARS as $kljuc => $vrednost)
{
  $forma[$kljuc] = $vrednost;
}
foreach ($HTTP_POST_VARS as $kljuc => $vrednost)
{
  $forma[$kljuc] = $vrednost;
}
  $sql = \'SELECT * FROM proba WHERE naziv LIKE "%\'.$forma["naziv"].\'%"\';
  mysql_connect("localhost","username","password");
  mysql_select_db("proba");
  $PD = mysql_query($sql);
  for ($i = 0; $i     {
      echo mysql_result($PD,$i,1) . "
";
     }
  mysql_free_result($PD);
?>


mysql - this is example of what I have in mysql

CREATE TABLE `proba` (
  `sifra` int(5) NOT NULL auto_increment,
  `naziv` text character set utf8 collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`sifra`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;

--
-- Dumping data for table `proba`
--

INSERT INTO `proba` VALUES (1, \'ПЕРА\');
INSERT INTO `proba` VALUES (2, \'СТЕВА\');
INSERT INTO `proba` VALUES (3, \'МИЛАН\');
INSERT INTO `proba` VALUES (4, \'ЛАЗА\');
INSERT INTO `proba` VALUES (5, \'МИРЈАНА\');
INSERT INTO `proba` VALUES (6, \'МИЛОРАД\');
INSERT INTO `proba` VALUES (7, \'ИВАН\');
INSERT INTO `proba` VALUES (8, \'ИГОР\');


I can\'t make this code works. I am from Serbia and we use cyrillic. So when I insert some text in mysql, I have this (above) in mysql tables. This quick search (search as you tape) works with latin but not with cyrillic. Does anyone know what\'s the problem?
I try to change charset but no use.

Thanks