|
|
|
| Доброго времи суток!!
Подскажите пожалуйста.
У меня в БД хранится список улиц (на русском языке) я делаю autocomplete для автозаполнения...но он не хочет вообще их выводить..
а на английском языке выводит.
Может кто сталкивался подскажите пожалуйста! | |
|
|
|
|
|
|
|
для: IceDevil
(18.08.2010 в 12:37)
| | Вы кодируете строку перед отправкой её скрипту? | |
|
|
|
|
|
|
|
для: bishake
(18.08.2010 в 16:49)
| | вроде нет....код не мой...я не вижу никаких намеков на кодировку.....
вот index.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>jQuery Autocomplete Plugin</title>
<script type="text/javascript" src="include/jquery-1.2.6.pack.js"></script>
<script type='text/javascript' src='include/jquery.autocomplete.pack.js'></script>
<!-- Autocomplete Formatting -->
<link rel="stylesheet" type="text/css" href="include/jquery.autocomplete.css" />
<script type="text/javascript">
$().ready(function() {
$("#targetDiv").autocomplete("include/mysql.php", {
width: 260,
selectFirst: true
});
});
</script>
</head>
<body>
<p>
<strong>Input Field</strong>
<input type="text" id="targetDiv" />
</p>
</body>
</html>
|
а это mysql.php
<?php
header('Content-Type: text/html; charset=utf-8');
$q = $_GET["q"];
if (!$q) return;
$dbhost = "localhost"; // Database Host
$dbuser = "root"; // User
$dbpass = "1234"; // Password
$dbname = "shcool"; // Name of Database
mysql_connect( $dbhost, $dbuser, $dbpass ) or die( mysql_error() );
mysql_select_db( $dbname ) or die( mysql_error() );
// Replace "TABLE_NAME" below with the table you'd like to extract data from
$data = mysql_query( "SELECT * FROM dfg756DL_adres" )
or die( mysql_error() );
// Replace "COLUMN_ONE" below with the column you'd like to search through
// In between the if/then statement, you may present a string of text
// you'd like to appear in the textbox.
while( $row = mysql_fetch_array( $data )){
if ( strpos( strtolower( $row['adres'] ), $q ) !== false ) {
echo $row['adres'] . " - " . $row['dom'] . "\n";
}
}
?>
|
| |
|
|
|
|
|
|
|
для: IceDevil
(19.08.2010 в 07:28)
| |  - перед вызовом header() | |
|
|
|
|
|
|
|
для: mihdan
(20.08.2010 в 00:57)
| | это случайно попало....там нету его... | |
|
|
|
|
|
|
|
для: IceDevil
(20.08.2010 в 08:44)
| | А так?
<?php
while( $row = mysql_fetch_array( $data )){
//if ( strpos( strtolower( $row['adres'] ), $q ) !== false ) {
echo $row['adres'] . " - " . $row['dom'] . "\n";
//}
}
?>
|
| |
|
|
|